Allow user to terminate the parser - close #13
This commit is contained in:
1 parent
92c76b74c8
commit
24af3590d1
8 files changed
+162
-14
No files matched your search
@@ -729,6 +729,26 @@ EOF
|
||||
expect(results.stderr).to eq ""
|
||||
expect(results.status).to eq 0
|
||||
end
|
||||
|
||||
it "allows the user to terminate the parser" do
|
||||
write_grammar <<EOF
|
||||
token a;
|
||||
token b;
|
||||
token c;
|
||||
Start -> Any;
|
||||
Any -> a Any;
|
||||
Any -> b Any <<
|
||||
$terminate(4200);
|
||||
>>
|
||||
Any -> c Any;
|
||||
Any -> ;
|
||||
EOF
|
||||
build_parser(language: language)
|
||||
compile("spec/test_user_terminate.#{language}", language: language)
|
||||
results = run
|
||||
expect(results.stderr).to eq ""
|
||||
expect(results.status).to eq 0
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user