test not, remove requirement of padding

This commit is contained in:
Ari Lazier 2015-11-12 15:19:32 -08:00
parent fcf77f01c7
commit b926b602d9
2 changed files with 24 additions and 1 deletions

View File

@ -91,7 +91,7 @@ struct group_pred : if_must< one< '(' >, pad< pred, blank >, one< ')' > > {};
struct true_pred : pegtl_istring_t("truepredicate") {}; struct true_pred : pegtl_istring_t("truepredicate") {};
struct false_pred : pegtl_istring_t("falsepredicate") {}; struct false_pred : pegtl_istring_t("falsepredicate") {};
struct not_pre : sor< seq< one< '!' >, star< blank > >, seq< pegtl_istring_t("not"), plus< blank > > > {}; struct not_pre : seq< sor< one< '!' >, seq< pegtl_istring_t("not") >, star< blank > > > {};
struct atom_pred : seq< opt< not_pre >, pad< sor< group_pred, true_pred, false_pred, comparison_pred >, blank > > {}; struct atom_pred : seq< opt< not_pre >, pad< sor< group_pred, true_pred, false_pred, comparison_pred >, blank > > {};
struct and_op : sor< pad< two< '&' >, blank >, pad_plus< pegtl_istring_t("and"), blank > > {}; struct and_op : sor< pad< two< '&' >, blank >, pad_plus< pegtl_istring_t("and"), blank > > {};

View File

@ -51,6 +51,20 @@ static std::vector<std::string> valid_queries = {
"0 contains 0", "0 contains 0",
"0 BeGiNsWiTh 0", "0 BeGiNsWiTh 0",
"0 ENDSWITH 0", "0 ENDSWITH 0",
// atoms/groups
"(0=0)",
"( 0=0 )",
"((0=0))",
"!0=0",
"! 0=0",
"!(0=0)",
"! (0=0)",
"NOT0=0", // keypath NOT0
"not 0=0",
"NOT(0=0)",
"not (0=0)",
"NOT (!0=0)",
}; };
static std::vector<std::string> invalid_queries = { static std::vector<std::string> invalid_queries = {
@ -86,6 +100,15 @@ static std::vector<std::string> invalid_queries = {
"0 contains1", "0 contains1",
"endswith 0", "endswith 0",
// atoms/groups
"0=0)",
"(0=0",
"(0=0))",
"! =0",
"NOTNOT(0=0)",
"(!!0=0)",
"0=0 !",
"truepredicate &&", "truepredicate &&",
"truepredicate & truepredicate", "truepredicate & truepredicate",
}; };