mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
multistart: toy with it in lexcalc
* examples/c/lexcalc/parse.y: Define several start symbols. * examples/c/lexcalc/lexcalc.test: Check support.
This commit is contained in:
@@ -20,6 +20,15 @@ cat >input <<EOF
|
||||
EOF
|
||||
run 0 7
|
||||
|
||||
cat >input <<EOF
|
||||
1
|
||||
2
|
||||
3
|
||||
EOF
|
||||
run 0 '1
|
||||
2
|
||||
3'
|
||||
|
||||
cat >input <<EOF
|
||||
(1+2) * 3
|
||||
EOF
|
||||
@@ -35,3 +44,17 @@ cat >input <<EOF
|
||||
1 / (2 - 2)
|
||||
EOF
|
||||
run 1 'err: 1.1-11: error: division by zero'
|
||||
|
||||
|
||||
# Multistart: parse "line" instead of "input".
|
||||
cat >input <<EOF
|
||||
1+2*3
|
||||
EOF
|
||||
run 0 7 -l
|
||||
|
||||
cat >input <<EOF
|
||||
1
|
||||
2
|
||||
EOF
|
||||
run 1 '1
|
||||
err: 2.1: syntax error, unexpected number, expecting end of file' -l
|
||||
|
||||
Reference in New Issue
Block a user