Do not consume lookahead token when reducing
This commit is contained in:
1 parent
f2cc5b112e
commit
2fbe13e071
3 files changed
+41
-3
No files matched your search
@@ -68,6 +68,8 @@ R1 -> a b;
|
||||
R2 -> a b;
|
||||
EOF
|
||||
build_parser
|
||||
compile("spec/test_d_lexer3.d")
|
||||
run
|
||||
end
|
||||
|
||||
it "handles reducing a rule that could be arrived at from multiple states" do
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
import testparser;
|
||||
import std.stdio;
|
||||
|
||||
int main()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
unittest
|
||||
{
|
||||
string input = "aba";
|
||||
auto parser = new Testparser.Parser(cast(const(ubyte) *)input.ptr, input.length);
|
||||
assert(parser.parse() == true);
|
||||
|
||||
input = "abb";
|
||||
parser = new Testparser.Parser(cast(const(ubyte) *)input.ptr, input.length);
|
||||
assert(parser.parse() == true);
|
||||
}
|
||||
Reference in new issue
Block a user