Allow storing a result value for a token from a lexer code block

This commit is contained in:
josh committed 2022-10-16 21:40:25 -04:00
1 parent ca8a360c0e
commit bca0a14371
4 files changed
+74 -19

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
import testparser;
import std.stdio;
int main()
{
return 0;
}
unittest
{
string input = `x`;
auto parser = new Testparser.Parser(input);
assert(parser.parse() == true);
assert(parser.result == 1u);
input = `fabulous`;
parser = new Testparser.Parser(input);
assert(parser.parse() == true);
assert(parser.result == 8u);
}