WIP refactoring
This commit is contained in:
@@ -14,7 +14,7 @@ void test_ident(void) {
|
||||
/* ^[a-zA-Z_][a-zA-Z0-9_]*$ */
|
||||
|
||||
mpc_parser_t* Ident = mpc_enclose(
|
||||
mpc_and(2, mpcf_astrfold,
|
||||
mpc_and(2, mpcf_strfold,
|
||||
mpc_or(2, mpc_alpha(), mpc_underscore()),
|
||||
mpc_many1(mpcf_strfold, mpc_or(3, mpc_alpha(), mpc_underscore(), mpc_digit())),
|
||||
free),
|
||||
|
@@ -18,6 +18,13 @@ void test_regex_basic(void) {
|
||||
re4 = mpc_re("ab|c(abdd)?");
|
||||
re5 = mpc_re("abc(ab|dd)+g$");
|
||||
|
||||
mpc_print(re0);
|
||||
mpc_print(re1);
|
||||
mpc_print(re2);
|
||||
mpc_print(re3);
|
||||
mpc_print(re4);
|
||||
mpc_print(re5);
|
||||
|
||||
PT_ASSERT(mpc_match(re0, "abc", "abc", string_eq, free, string_print));
|
||||
PT_ASSERT(mpc_match(re0, "bcd", "bcd", string_eq, free, string_print));
|
||||
PT_ASSERT(mpc_unmatch(re0, "bc", "bc", string_eq, free, string_print));
|
||||
|
Reference in New Issue
Block a user