Allow dashes in non-terminal names

db4
Chris Double 2008-01-18 15:45:08 +13:00
parent 449962b71e
commit f272d54e49
1 changed files with 1 additions and 1 deletions

View File

@ -99,7 +99,7 @@ M: ebnf (generate-parser) ( ast -- id )
DEFER: 'rhs'
: 'non-terminal' ( -- parser )
CHAR: a CHAR: z range repeat1 [ >string <ebnf-non-terminal> ] action ;
CHAR: a CHAR: z range "-" token [ first ] action 2array choice repeat1 [ >string <ebnf-non-terminal> ] action ;
: 'terminal' ( -- parser )
"'" token hide [ CHAR: ' = not ] satisfy repeat1 "'" token hide 3array seq [ first >string <ebnf-terminal> ] action ;