Add lexer modes and $mode() code expansion

This commit is contained in:
josh committed 2022-10-09 22:49:01 -04:00
1 parent b2d11321fe
commit 02be6de48e
6 files changed
+145 -38

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
import testparser;
import std.stdio;
int main()
{
return 0;
}
unittest
{
string input = `abc "a string" def`;
auto parser = new Testparser.Parser(cast(const(ubyte) *)input.ptr, input.length);
assert(parser.parse() == true);
writeln("pass1");
input = `abc "abc def" def`;
parser = new Testparser.Parser(cast(const(ubyte) *)input.ptr, input.length);
assert(parser.parse() == true);
writeln("pass2");
}