narrow escape

This commit is contained in:
Rutger van Beusekom 2018-11-13 09:02:35 +01:00
parent 983b9b355a
commit d667922bbd
6 changed files with 9 additions and 4 deletions

View File

@ -8,6 +8,7 @@ tests="
00-exit
00-exit-0
00-exit-1
00-exit-2
01-script-newline
01-script-semi

View File

@ -169,8 +169,10 @@
ltest < '['
rtest < ']'
literal <- !reserved (!']' ![ \t\v\f\n`'\")};|&$] (escape / .))+
escape <- '\\' [ \"$]
literal <- !reserved (escaped / !allowed .)+
escaped <- escape [ \"$]
escape < [\\]
allowed <- ']' / [ \t\v\f\n`'\")};|&$] / '\\\n'
identifier <- [_a-zA-Z][_a-zA-Z0-9]*

1
test/00-exit-2.exit Normal file
View File

@ -0,0 +1 @@
2

1
test/00-exit-2.sh Normal file
View File

@ -0,0 +1 @@
exit 2

View File

@ -1 +1 @@
2
0

View File

@ -1,2 +1,2 @@
exit\
2
0