Add slightly more complex grammar with quantifiers to test references with quantifiers.
This commit is contained in:
parent
ab606c030f
commit
8f17815ca8
1 changed files with 24 additions and 0 deletions
|
@ -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",
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue