summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAkim Demaille <akim.demaille@gmail.com>2020-04-26 14:48:59 +0200
committerAkim Demaille <akim.demaille@gmail.com>2020-04-26 19:55:52 +0200
commitb254b36db8d281e11a2ff062ea5bbfd222a820eb (patch)
tree7df5de14ca3e92665a60c89fe36fecadf2913e99 /tests
parent58e79539fcf51bbaf7284f948cfd216c2076a815 (diff)
downloadbison-b254b36db8d281e11a2ff062ea5bbfd222a820eb.tar.gz
all: don't emit an error message when the scanner returns YYERRCODE
I'm quite pleased to see that the tricky case of glr.c was already prepared by the changes to support syntax_error exceptions. Better yet, it is actually syntax_error that becomes a special case of the general pattern: make yytoken be YYERRCODE. * data/skeletons/glr.c (YYFAULTYTOK): Remove the now useless (Basil) Faulty token. Instead, use the error token. * data/skeletons/lalr1.d, data/skeletons/lalr1.java: When computing the action, first check the case of the error token. * tests/calc.at: Check cases for the error token symbols before and after it.
Diffstat (limited to 'tests')
-rw-r--r--tests/calc.at15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/calc.at b/tests/calc.at
index a3711612..67fb21aa 100644
--- a/tests/calc.at
+++ b/tests/calc.at
@@ -1036,6 +1036,21 @@ _AT_CHECK_CALC_ERROR([$1], [0], [(#) + (#) = 2222],
[[1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#']])
+_AT_CHECK_CALC_ERROR([$1], [0], [(1 + #) = 1111],
+ [[final: 1111 0 0]],
+ [102],
+[[1.6: syntax error: invalid character: '#']])
+
+_AT_CHECK_CALC_ERROR([$1], [0], [(# + 1) = 1111],
+ [[final: 1111 0 0]],
+ [102],
+[[1.2: syntax error: invalid character: '#']])
+
+_AT_CHECK_CALC_ERROR([$1], [0], [(1 + # + 1) = 1111],
+ [[final: 1111 0 0]],
+ [102],
+[[1.6: syntax error: invalid character: '#']])
+
AT_BISON_OPTION_POPDEFS