Switch to new API - close #8
The new API is more C-like and will allow consistency across all future supported language targets.
This commit is contained in:
1 parent
e0e5e87338
commit
7a1b4064c1
15 files changed
+611
-481
No files matched your search
@@ -9,12 +9,13 @@ int main()
|
||||
unittest
|
||||
{
|
||||
string input = `x`;
|
||||
auto parser = new Parser(input);
|
||||
assert(parser.parse() == P_SUCCESS);
|
||||
assert(parser.result == 1u);
|
||||
p_context_t context;
|
||||
p_context_init(&context, input);
|
||||
assert(p_parse(&context) == P_SUCCESS);
|
||||
assert(p_result(&context) == 1u);
|
||||
|
||||
input = `fabulous`;
|
||||
parser = new Parser(input);
|
||||
assert(parser.parse() == P_SUCCESS);
|
||||
assert(parser.result == 8u);
|
||||
p_context_init(&context, input);
|
||||
assert(p_parse(&context) == P_SUCCESS);
|
||||
assert(p_result(&context) == 8u);
|
||||
}
|
||||
Reference in new issue
Block a user