summaryrefslogtreecommitdiff
path: root/tests/regression.at
diff options
context:
space:
mode:
authorAkim Demaille <akim.demaille@gmail.com>2020-04-12 09:54:46 +0200
committerAkim Demaille <akim.demaille@gmail.com>2020-04-12 13:56:44 +0200
commit72c9fa4510eb677cf80feb0d161eb38f97ddffe9 (patch)
tree279fee0844add796b22efd52c5b5b90ce35bd6bf /tests/regression.at
parenta555b419904c3619f417f9698b9234d9084c65e5 (diff)
downloadbison-72c9fa4510eb677cf80feb0d161eb38f97ddffe9.tar.gz
skeletons: use "end of file" instead of "$end"
The name "$end" is nice in the report, in particular it avoids that pointed-rules (aka items) be too long. It also helps keeping them "standard". But it is bad in error messages, we should report "end of file" (or maybe "end of input", this is debatable). So, unless the user already defined the alias for the error token herself, make it "end of file". It should even be translated if the user already translated some tokens, so that there is now no strong reason to redefine the $end token. * src/output.c (prepare_symbol_names): Issue "end of file" instead of "$end". * data/skeletons/lalr1.java (yytnamerr_): Remove the renaming hack. * build-aux/update-test: Accept files with names containing a "+", such as c++.at. * tests/actions.at, tests/c++.at, tests/conflicts.at, * tests/glr-regression.at, tests/regression.at, tests/skeletons.at: Adjust.
Diffstat (limited to 'tests/regression.at')
-rw-r--r--tests/regression.at17
1 files changed, 9 insertions, 8 deletions
diff --git a/tests/regression.at b/tests/regression.at
index cd79b507..52c88e98 100644
--- a/tests/regression.at
+++ b/tests/regression.at
@@ -701,8 +701,9 @@ static const yytype_int8 yyrline[] =
};
static const char *const yytname[] =
{
- "$end", "error", "$undefined", "\"if\"", "\"const\"", "\"then\"",
- "\"else\"", "$accept", "statement", "struct_stat", "if", "else", YY_NULLPTR
+ "\"end of file\"", "error", "$undefined", "\"if\"", "\"const\"",
+ "\"then\"", "\"else\"", "$accept", "statement", "struct_stat", "if",
+ "else", YY_NULLPTR
};
static const yytype_int16 yytoknum[] =
{
@@ -967,7 +968,7 @@ Entering state 1
Stack now 0 1
Reading a token
Next token is token 'a' (PRINTER)
-syntax error, unexpected 'a', expecting $end
+syntax error, unexpected 'a', expecting end of file
Error: popping nterm start ()
Stack now 0
Cleanup: discarding lookahead token 'a' (PRINTER)
@@ -1177,7 +1178,7 @@ AT_BISON_CHECK([[-o input.c input.y]])
AT_COMPILE([[input]])
AT_PARSER_CHECK([[input]], [[1]], [],
[[syntax error, unexpected 'a', expecting 123456789112345678921234567893123456789412345678951234567896123A or 123456789112345678921234567893123456789412345678951234567896123B
-syntax error, unexpected $end, expecting 123456789112345678921234567893123456789412345678951234567896123A or 123456789112345678921234567893123456789412345678951234567896123B
+syntax error, unexpected end of file, expecting 123456789112345678921234567893123456789412345678951234567896123A or 123456789112345678921234567893123456789412345678951234567896123B
]])
AT_CLEANUP
@@ -1445,10 +1446,10 @@ Entering state 0
Stack now 0
Reading a token
Now at end of input.
-LAC: initial context established for $end
-LAC: checking lookahead $end: R2 G3 R2 G5 R2 G6 R2 G7 R2 G8 R2 G9 R2 G10 R2 G11 R2 (max size exceeded)
+LAC: initial context established for "end of file"
+LAC: checking lookahead "end of file": R2 G3 R2 G5 R2 G6 R2 G7 R2 G8 R2 G9 R2 G10 R2 G11 R2 (max size exceeded)
memory exhausted
-Cleanup: discarding lookahead token $end ()
+Cleanup: discarding lookahead token "end of file" ()
Stack now 0
]])
@@ -1464,7 +1465,7 @@ Next token is token $undefined ()
LAC: initial context established for $undefined
LAC: checking lookahead $undefined: Always Err
Constructing syntax error message
-LAC: checking lookahead $end: R2 G3 R2 G5 R2 G6 R2 G7 R2 G8 R2 G9 R2 G10 R2 G11 R2 (max size exceeded)
+LAC: checking lookahead "end of file": R2 G3 R2 G5 R2 G6 R2 G7 R2 G8 R2 G9 R2 G10 R2 G11 R2 (max size exceeded)
syntax error
memory exhausted
Cleanup: discarding lookahead token $undefined ()