examples: d: demonstrate location tracking

* examples/d/calc/calc.y: Track locations.
* examples/d/calc/calc.test: Check locations.
This commit is contained in:
Adela Vais
2020-09-03 08:42:06 +02:00
committed by Akim Demaille
parent 8032dde383
commit 6e1d83c8a8
3 changed files with 60 additions and 10 deletions

View File

@@ -33,4 +33,19 @@ run 0 5
cat >input <<EOF
1 + 2 * * 3
EOF
run 1 "err: syntax error, unexpected *, expecting + or - or ( or number"
run 1 "err: 1.9: syntax error, unexpected *, expecting + or - or ( or number"
cat >input <<EOF
1111 + 1111 2222
EOF
run 1 "err: 1.13-16: syntax error, unexpected number"
cat >input <<EOF
1 +
EOF
run 1 "err: 1.4-2.0: syntax error, unexpected end of line, expecting + or - or ( or number"
cat >input <<EOF
99 009
EOF
run 1 "err: 1.4-6: syntax error, unexpected number"