Make the EOF be an auxiliary symbol
This way, it couldn’t conflict if a user had a rule called “__END__”
This commit is contained in:
parent
15c9e2d398
commit
3cb65c9c81
6 changed files with 659 additions and 670 deletions
|
|
@ -77,19 +77,6 @@ describe("building parse and lex tables", []() {
|
|||
CharacterSet({ {'a', 'z'}, {'A', 'Z'} }, true),
|
||||
})));
|
||||
});
|
||||
|
||||
it("accepts when the start symbol is reduced", [&]() {
|
||||
AssertThat(parse_state(1).actions, Equals(map<Symbol, parse_actions>({
|
||||
{ Symbol("__END__"), parse_actions({ ParseAction::Accept() }) }
|
||||
})));
|
||||
});
|
||||
|
||||
it("has the right next states", [&]() {
|
||||
AssertThat(parse_state(2).actions, Equals(map<Symbol, parse_actions>({
|
||||
{ Symbol("plus"), parse_actions({ ParseAction::Shift(3) }) },
|
||||
{ Symbol("__END__"), parse_actions({ ParseAction::Reduce(Symbol("expression"), { false }) }) },
|
||||
})));
|
||||
});
|
||||
});
|
||||
|
||||
END_TEST
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue