Commit 2526426
committed
Fix parser to reject incomplete reductions like ([ and ({
Fixes #3138
The parser was incorrectly accepting expressions like ([ and ({
as valid syntax, parsing them as atoms instead of rejecting them as
incomplete reductions.
This fix adds checks in reduce_brackets() to reject when an opening
parenthesis is followed by:
- Opening bracket [
- Opening curly brace {
Note: (, and (( were already correctly rejected by existing checks.
This brings the behavior in line with how curly braces work, where
{[ and {( correctly produce syntax errors.
Added tests in src/tests/syntax_errors.pl to verify the fix and
prevent regressions.1 parent e4d9692 commit 2526426
File tree
3 files changed
+41
-2
lines changed- src
- parser
- tests
- tests/scryer/cli/src_tests
3 files changed
+41
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
829 | 829 | | |
830 | 830 | | |
831 | 831 | | |
832 | | - | |
833 | | - | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
834 | 842 | | |
835 | 843 | | |
836 | 844 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
0 commit comments