mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-11 13:23:04 +00:00
java: examples: fix the tracking of locations
* examples/java/calc/Calc.y: The StreamTokenizer cannot "peek" for the next character, it reads it, and keeps it for the next call. So the current location is one passed the end of the current token. To avoid this, keep the previous position, and use it to end the current token. * examples/java/calc/Calc.test: Adjust.
This commit is contained in:
@@ -30,4 +30,9 @@ run 0 '7
|
||||
cat >input <<EOF
|
||||
1 + 2 * * 3
|
||||
EOF
|
||||
run 0 "err: 1.8-1.9: syntax error, unexpected '*', expecting number or '-' or '(' or '!'"
|
||||
run 0 "err: 1.9-1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'"
|
||||
|
||||
cat >input <<EOF
|
||||
12 222
|
||||
EOF
|
||||
run 0 "err: 1.6-1.9: syntax error, unexpected number"
|
||||
|
||||
Reference in New Issue
Block a user