Test suite now builds

This commit is contained in:
Dan Hirsch 2013-12-16 18:47:42 +01:00
parent ee751a97c1
commit 14a5c5c1ef
9 changed files with 639 additions and 14 deletions

View file

@ -215,7 +215,7 @@ many1 {
test "daabbabadef" --> fail;
}
repeat-n {
repeat_n {
parser repeat_n(choice(ch('a'),ch('b')),0x2);
test "adef" --> fail;
test "abdef" --> ['a','b'];
@ -270,11 +270,11 @@ and {
}
not {
parser sequence(ch('a'), choice(token('+'), token("++")), ch('b'));
parser sequence(ch('a'), choice(token("+"), token("++")), ch('b'));
test "a+b" --> ['a',"+",'b'];
test "a++b" --> fail;
parser sequence(ch('a'), choice(sequence(token('+'), not(ch('+'))),
parser sequence(ch('a'), choice(sequence(token("+"), not(ch('+'))),
token("++")),
ch('b'));
test "a+b" --> ['a', ["+"], 'b'];