Allow configuring API prefix - close #9

This commit is contained in:
josh committed 2023-07-13 18:06:24 -04:00
1 parent 7d7929a358
commit 5ce562cbc3
5 files changed
+136 -59

No files matched your search

+4
View File
@@ -34,6 +34,7 @@ EOF
expect(grammar.modulename).to eq "a.b"
expect(grammar.ptype).to eq "XYZ *"
expect(grammar.ptypes).to eq("default" => "XYZ *")
expect(grammar.prefix).to eq "p_"
o = grammar.tokens.find {|token| token.name == "while"}
expect(o).to_not be_nil
@@ -111,8 +112,11 @@ token code2 <<
>>
tokenid token_with_no_pattern;
prefix myparser_;
EOF
grammar = Grammar.new(input)
expect(grammar.prefix).to eq "myparser_"
o = grammar.tokens.find {|token| token.name == "code1"}
expect(o).to_not be_nil