Add semicolon to end of all grammar statements
This commit is contained in:
1 parent
382e17804c
commit
b682c72b17
3 files changed
+33
-33
No files matched your search
+14
-14
@@ -27,10 +27,10 @@ describe Propane do
|
||||
|
||||
it "generates a D lexer" do
|
||||
write_grammar <<EOF
|
||||
token int \\d+
|
||||
token plus \\+
|
||||
token times \\*
|
||||
drop \\s+
|
||||
token int \\d+;
|
||||
token plus \\+;
|
||||
token times \\*;
|
||||
drop \\s+;
|
||||
Start -> Foo;
|
||||
Foo -> int <<
|
||||
>>
|
||||
@@ -44,10 +44,10 @@ EOF
|
||||
|
||||
it "generates a parser" do
|
||||
write_grammar <<EOF
|
||||
token plus \\+
|
||||
token times \\*
|
||||
token zero 0
|
||||
token one 1
|
||||
token plus \\+;
|
||||
token times \\*;
|
||||
token zero 0;
|
||||
token one 1;
|
||||
Start -> E;
|
||||
E -> E times B;
|
||||
E -> E plus B;
|
||||
@@ -60,7 +60,7 @@ EOF
|
||||
|
||||
it "generates an SLR parser" do
|
||||
write_grammar <<EOF
|
||||
token one 1
|
||||
token one 1;
|
||||
Start -> E;
|
||||
E -> one E;
|
||||
E -> one;
|
||||
@@ -70,8 +70,8 @@ EOF
|
||||
|
||||
it "distinguishes between multiple identical rules with lookahead symbol" do
|
||||
write_grammar <<EOF
|
||||
token a
|
||||
token b
|
||||
token a;
|
||||
token b;
|
||||
Start -> R1 a;
|
||||
Start -> R2 b;
|
||||
R1 -> a b;
|
||||
@@ -84,9 +84,9 @@ EOF
|
||||
|
||||
it "handles reducing a rule that could be arrived at from multiple states" do
|
||||
write_grammar <<EOF
|
||||
token a
|
||||
token b
|
||||
drop \\s+
|
||||
token a;
|
||||
token b;
|
||||
drop \\s+;
|
||||
Start -> a R1;
|
||||
Start -> b R1;
|
||||
R1 -> b;
|
||||
|
||||
Reference in new issue
Block a user