]> gitweb.factorcode.org Git - factor.git/commitdiff
Fix regression where multiply defined ebnf rules didn't result in an error
authorChris Double <chris@bethia.(none)>
Tue, 15 Jul 2008 03:42:13 +0000 (15:42 +1200)
committerChris Double <chris@bethia.(none)>
Tue, 15 Jul 2008 03:42:13 +0000 (15:42 +1200)
extra/peg/ebnf/ebnf-tests.factor
extra/peg/ebnf/ebnf.factor

index 7f14293a1541fc136fe166f8cb0ea5208194689d..45e1e9b2187490ae3b11f9e8b9fc696c9cd14bb8 100644 (file)
@@ -449,7 +449,7 @@ foo=<foreign any-char> 'd'
 ] unit-test
 
 [
-  "USING: peg.ebnf ; \"ab\" [EBNF foo='a' foo='b' EBNF]" eval drop
+  "USING: peg.ebnf ; <EBNF foo='a' foo='b' EBNF>" eval drop
 ] must-fail
 
 { t } [
@@ -519,4 +519,4 @@ Tok                = Spaces (Number | Special )
 
 { "\\" } [
   "\\" [EBNF foo="\\" EBNF]
-] unit-test
\ No newline at end of file
+] unit-test
index 2a75fcccc03ebbb24f3479922d2a5d0e0b09d236..cc94a215e6ad2f301c9bbf2e1ffbe6997fa9e868 100644 (file)
@@ -371,7 +371,7 @@ M: ebnf-tokenizer (transform) ( ast -- parser )
 M: ebnf-rule (transform) ( ast -- parser )\r
   dup elements>> \r
   (transform) [\r
-    swap symbol>> dup get { [ tuple? ] [ delegate parser? ] } 1&& [ \r
+    swap symbol>> dup get parser? [ \r
       "Rule '" over append "' defined more than once" append throw \r
     ] [ \r
       set \r