Skip to content

Commit

Permalink
nitcc: add tests for plusize and cie.
Browse files Browse the repository at this point in the history
Signed-off-by: Jean Privat <[email protected]>
  • Loading branch information
privat committed Jun 23, 2024
1 parent 033b0bc commit 3aae1d0
Show file tree
Hide file tree
Showing 9 changed files with 109 additions and 0 deletions.
3 changes: 3 additions & 0 deletions contrib/nitcc/tests/parser-plusize.input
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
s ab
s abab
s abb
8 changes: 8 additions & 0 deletions contrib/nitcc/tests/parser-plusize.sablecc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Grammar gram;
Lexer
blank = #10 | #13 | #32;
Parser
Ignored blank;
s = s 's' t | Empty;
t = ab+ ;
ab = 'a' 'b' ;
3 changes: 3 additions & 0 deletions contrib/nitcc/tests/parser-questize.input
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sabc
sac
sabbc
7 changes: 7 additions & 0 deletions contrib/nitcc/tests/parser-questize.sablecc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Grammar gram;
Lexer
blank = #10 | #13 | #32;
Parser
Ignored blank;
s = s 's' t | Empty;
t = 'a' 'b'? 'c';
4 changes: 4 additions & 0 deletions contrib/nitcc/tests/parser-starize.input
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
s
sab
sabab
saba
8 changes: 8 additions & 0 deletions contrib/nitcc/tests/parser-starize.sablecc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Grammar gram;
Lexer
blank = #10 | #13 | #32;
Parser
Ignored blank;
s = s 's' t | Empty;
t = ab* ;
ab = 'a' 'b';
28 changes: 28 additions & 0 deletions contrib/nitcc/tests/sav/parser-plusize.input.res
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
NParserError@(3:5-3:6)='b'
Nodes[Node]
s_0
s_0
s_0
s_1
's'@(1:1-1:2)
t
Nodes[Nab]
ab
'a'@(1:3-1:4)
'b'@(1:4-1:5)
's'@(2:1-2:2)
t
Nodes[Nab]
ab
'a'@(2:3-2:4)
'b'@(2:4-2:5)
ab
'a'@(2:5-2:6)
'b'@(2:6-2:7)
's'@(3:1-3:2)
t
Nodes[Nab]
ab
'a'@(3:3-3:4)
'b'@(3:4-3:5)
'b'@(3:5-3:6)
18 changes: 18 additions & 0 deletions contrib/nitcc/tests/sav/parser-questize.input.res
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
NParserError@(3:4-3:5)='b'
Nodes[Node]
s_0
s_0
s_1
's'@(1:1-1:2)
t
'a'@(1:2-1:3)
'b'@(1:3-1:4)
'c'@(1:4-1:5)
's'@(2:1-2:2)
t
'a'@(2:2-2:3)
'c'@(2:3-2:4)
's'@(3:1-3:2)
'a'@(3:2-3:3)
'b'@(3:3-3:4)
'b'@(3:4-3:5)
30 changes: 30 additions & 0 deletions contrib/nitcc/tests/sav/parser-starize.input.res
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
NParserError@(5:1-5:1)=''
Nodes[Node]
s_0
s_0
s_0
s_1
's'@(1:1-1:2)
t
's'@(2:1-2:2)
t
Nodes[Nab]
ab
'a'@(2:2-2:3)
'b'@(2:3-2:4)
's'@(3:1-3:2)
t
Nodes[Nab]
ab
'a'@(3:2-3:3)
'b'@(3:3-3:4)
ab
'a'@(3:4-3:5)
'b'@(3:5-3:6)
's'@(4:1-4:2)
Nodes[Nab]
ab
'a'@(4:2-4:3)
'b'@(4:3-4:4)
'a'@(4:4-4:5)
Eof@(5:1-5:1)=''

0 comments on commit 3aae1d0

Please sign in to comment.