]> gitweb.factorcode.org Git - factor.git/commitdiff
Allow - in peg.ebnf identifiers. Eating still not allowed...
authorDoug Coleman <doug.coleman@gmail.com>
Tue, 4 May 2010 04:40:50 +0000 (23:40 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Tue, 4 May 2010 04:40:50 +0000 (23:40 -0500)
basis/peg/ebnf/ebnf-tests.factor
basis/peg/ebnf/ebnf.factor

index 825e07dbf8642bec025e05a6cb01f243b6c50b06..accbec6fd72041ca769bb75c1274d36daf163978 100644 (file)
@@ -549,3 +549,10 @@ Tok                = Spaces (Number | Special )
     EBNF: foo3   Bar = "a":11 "a":22 => [[ 11 22 2array ]] ;EBNF
     "aa" foo3
 ] unit-test
+
+[
+    { "a" "a" }
+] [
+    EBNF: foo4   Bar = "a":a-1 "a":a-2 => [[ a-1 a-2 2array ]] ;EBNF
+    "aa" foo4
+] unit-test
index 4462330a44360e46aa44a20eeee53d8a58e065a2..29123b7126696aeea603543c46120a5b49d126ef 100644 (file)
@@ -230,7 +230,7 @@ DEFER: 'action'
 \r
 : 'element' ( -- parser )\r
   [\r
-    [ ('element') , ":" syntax , "(a-zA-Z0-9_)+" range-pattern repeat1 [ >string ] action , ] seq* [ first2 <ebnf-var> ] action ,\r
+    [ ('element') , ":" syntax , "(a-zA-Z0-9_-)+" range-pattern repeat1 [ >string ] action , ] seq* [ first2 <ebnf-var> ] action ,\r
     ('element') ,\r
   ] choice* ;\r
 \r