Add support for multiple starting rules - close #38
This commit is contained in:
1 parent
cb426b4be1
commit
6a87bb2d56
14 files changed
+383
-37
No files matched your search
@@ -0,0 +1,29 @@
|
||||
import testparser;
|
||||
import std.stdio;
|
||||
import testutils;
|
||||
|
||||
int main()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
unittest
|
||||
{
|
||||
string input = "bbbb";
|
||||
p_context_t context;
|
||||
p_context_init(&context, input);
|
||||
assert(p_parse(&context) == P_SUCCESS);
|
||||
int result = p_result(&context);
|
||||
assert(result == 8);
|
||||
|
||||
p_context_init(&context, input);
|
||||
assert(p_parse_Bs(&context) == P_SUCCESS);
|
||||
result = p_result_Bs(&context);
|
||||
assert(result == 8);
|
||||
|
||||
input = "c";
|
||||
p_context_init(&context, input);
|
||||
assert(p_parse_R(&context) == P_SUCCESS);
|
||||
result = p_result_R(&context);
|
||||
assert(result == 3);
|
||||
}
|
||||
Reference in new issue
Block a user