Commit 313d292
authored
fix: raise ParseError instead of AssertionError on unmatched '}' (#604)
An unmatched '}' (e.g. parser.parse('}')) reached an internal assertion
(c_parser.py:127: assert len(self._scope_stack) > 1) rather than returning
through the usual ParseError path. Callers that catch ParseError to handle
parse failures would not catch the AssertionError.
Replace the bare assert with an explicit ParseError so malformed input
travels the documented error path. Fixes #603.1 parent 89c9f3d commit 313d292
2 files changed
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
| 128 | + | |
128 | 129 | | |
129 | 130 | | |
130 | 131 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3783 | 3783 | | |
3784 | 3784 | | |
3785 | 3785 | | |
| 3786 | + | |
| 3787 | + | |
| 3788 | + | |
| 3789 | + | |
| 3790 | + | |
| 3791 | + | |
| 3792 | + | |
| 3793 | + | |
0 commit comments