Add failing ebnf test

db4
Chris Double 2008-04-03 16:09:03 +13:00
parent 90bb54f304
commit 27f2992dc5
1 changed files with 5 additions and 1 deletions

View File

@ -1,7 +1,7 @@
! Copyright (C) 2007 Chris Double. ! Copyright (C) 2007 Chris Double.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
! !
USING: kernel tools.test peg peg.ebnf words math math.parser ; USING: kernel tools.test peg peg.ebnf words math math.parser sequences ;
IN: peg.ebnf.tests IN: peg.ebnf.tests
{ T{ ebnf-non-terminal f "abc" } } [ { T{ ebnf-non-terminal f "abc" } } [
@ -247,6 +247,10 @@ IN: peg.ebnf.tests
"1+1+1" [EBNF num=([0-9])+ x=expr expr=x "+" num | num EBNF] call parse-result-ast "1+1+1" [EBNF num=([0-9])+ x=expr expr=x "+" num | num EBNF] call parse-result-ast
] unit-test ] unit-test
{ t } [
"abcd='9' | ('8'):x => [[ drop x ]]" 'ebnf' parse parse-result-remaining empty?
] unit-test
EBNF: primary EBNF: primary
Primary = PrimaryNoNewArray Primary = PrimaryNoNewArray
PrimaryNoNewArray = ClassInstanceCreationExpression PrimaryNoNewArray = ClassInstanceCreationExpression