Add slightly more complex grammar with quantifiers to test references with quantifiers.

This commit is contained in:
Clint Herron 2024-04-12 16:49:05 -04:00
parent ab606c030f
commit 8f17815ca8

View file

@ -216,6 +216,30 @@ static void test_quantifiers() {
"aa", "aa",
"ba", "ba",
} }
},
{
// Grammar
R"""(
root ::= cons+ vowel* cons? (vowel cons)*
vowel ::= [aeiouy]
cons ::= [bcdfghjklmnpqrstvwxyz]
)""",
// Passing strings
{
"yes",
"no",
"noyes",
"crwth",
"four",
"bryyyy",
},
// Failing strings
{
"yess",
"yesno",
"forty",
"catyyy",
}
} }
}; };