Allow a-zA-Z0-9_ in identifiers for peg.ebnf

db4
Doug Coleman 2010-05-03 23:35:17 -05:00
parent ea4ee4ff60
commit c7351595e5
2 changed files with 22 additions and 1 deletions

View File

@ -528,3 +528,24 @@ Tok = Spaces (Number | Special )
] [
error>> [ redefined-rule? ] [ name>> "lol" = ] bi and
] must-fail-with
[
{ "a" "a" }
] [
EBNF: foo Bar = "a":a1 "a":a2 => [[ a1 a2 2array ]] ;EBNF
"aa" foo
] unit-test
[
{ "a" "a" }
] [
EBNF: foo2 Bar = "a":1a "a":2a => [[ 1a 2a 2array ]] ;EBNF
"aa" foo2
] unit-test
[
{ "a" "a" }
] [
EBNF: foo3 Bar = "a":11 "a":22 => [[ 11 22 2array ]] ;EBNF
"aa" foo3
] unit-test

View File

@ -230,7 +230,7 @@ DEFER: 'action'
: 'element' ( -- parser )
[
[ ('element') , ":" syntax , "a-zA-Z" range-pattern repeat1 [ >string ] action , ] seq* [ first2 <ebnf-var> ] action ,
[ ('element') , ":" syntax , "(a-zA-Z0-9_)+" range-pattern repeat1 [ >string ] action , ] seq* [ first2 <ebnf-var> ] action ,
('element') ,
] choice* ;