working on fixing leftrec for packrat
This commit is contained in:
parent
0db4925469
commit
8681600365
1 changed files with 5 additions and 5 deletions
|
|
@ -410,11 +410,11 @@ static void test_leftrec(gconstpointer backend) {
|
||||||
HParser *a_ = h_ch('a');
|
HParser *a_ = h_ch('a');
|
||||||
|
|
||||||
HParser *lr_ = h_indirect();
|
HParser *lr_ = h_indirect();
|
||||||
h_bind_indirect(lr_, h_choice(h_sequence(lr_, a_, NULL), a_, NULL));
|
h_bind_indirect(lr_, h_choice(h_sequence(lr_, a_, NULL), h_epsilon_p(), NULL));
|
||||||
|
|
||||||
g_check_parse_ok(lr_, (HParserBackend)GPOINTER_TO_INT(backend), "a", 1, "u0x61");
|
g_check_parse_match(lr_, (HParserBackend)GPOINTER_TO_INT(backend), "a", 1, "(u0x61)");
|
||||||
g_check_parse_ok(lr_, (HParserBackend)GPOINTER_TO_INT(backend), "aa", 2, "(u0x61 u0x61)");
|
g_check_parse_match(lr_, (HParserBackend)GPOINTER_TO_INT(backend), "aa", 2, "((u0x61) u0x61)");
|
||||||
g_check_parse_ok(lr_, (HParserBackend)GPOINTER_TO_INT(backend), "aaa", 3, "((u0x61 u0x61) u0x61)");
|
g_check_parse_match(lr_, (HParserBackend)GPOINTER_TO_INT(backend), "aaa", 3, "(((u0x61) u0x61) u0x61)");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_rightrec(gconstpointer backend) {
|
static void test_rightrec(gconstpointer backend) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue