Throw an error if there are duplicate rules in ebnf

db4
Chris Double 2008-06-19 14:44:13 +12:00
parent c92224f5b9
commit 9b7e2bacc9
1 changed files with 1 additions and 1 deletions

View File

@ -305,7 +305,7 @@ M: ebnf (transform) ( ast -- parser )
M: ebnf-rule (transform) ( ast -- parser ) M: ebnf-rule (transform) ( ast -- parser )
dup elements>> dup elements>>
(transform) [ (transform) [
swap symbol>> set swap symbol>> dup get [ "Rule '" over append "' defined more than once" append throw ] [ set ] if
] keep ; ] keep ;
M: ebnf-sequence (transform) ( ast -- parser ) M: ebnf-sequence (transform) ( ast -- parser )