Make grammars' separator characters configurable
This commit is contained in:
parent
8aea89750d
commit
a9dff20658
5 changed files with 24 additions and 5 deletions
|
|
@ -107,6 +107,18 @@ describe("extracting tokens from a grammar", []() {
|
|||
})))
|
||||
});
|
||||
|
||||
it("preserves the separator characters in the lexical grammar", [&]() {
|
||||
pair<SyntaxGrammar, LexicalGrammar> result = extract_tokens(InternedGrammar{
|
||||
{
|
||||
{ "rule_A", str("ab") },
|
||||
},
|
||||
{},
|
||||
{ 'x', 'y', 'z' }
|
||||
});
|
||||
|
||||
AssertThat(result.second.separators, Equals(vector<char>({ 'x', 'y', 'z' })));
|
||||
});
|
||||
|
||||
describe("when an entire rule can be extracted", [&]() {
|
||||
it("moves the rule the lexical grammar when possible and updates referencing symbols", [&]() {
|
||||
auto result = extract_tokens(InternedGrammar{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue