Permalink
Browse files

Fixed bug when parsing rule names that begin with 'end'

  • Loading branch information...
1 parent 7c011e5 commit 42381b0b426d429336685300e0e6876e8e13e3b5 @mjackson committed Feb 4, 2011
Showing with 14 additions and 6 deletions.
  1. +6 −6 lib/citrus/file.rb
  2. +8 −0 test/_files/grammar3.citrus
View
@@ -316,12 +316,12 @@ def value
}
end
- rule :require_keyword, [ 'require', :space ]
- rule :include_keyword, [ 'include', :space ]
- rule :grammar_keyword, [ 'grammar', :space ]
- rule :root_keyword, [ 'root', :space ]
- rule :rule_keyword, [ 'rule', :space ]
- rule :end_keyword, [ 'end', :space ]
+ rule :require_keyword, [ /\brequire\b/, :space ]
+ rule :include_keyword, [ /\binclude\b/, :space ]
+ rule :grammar_keyword, [ /\bgrammar\b/, :space ]
+ rule :root_keyword, [ /\broot\b/, :space ]
+ rule :rule_keyword, [ /\brule\b/, :space ]
+ rule :end_keyword, [ /\bend\b/, :space ]
rule :lparen, [ '(', :space ]
rule :rparen, [ ')', :space ]
rule :lcurly, [ '{', :space ]
@@ -0,0 +1,8 @@
+grammar EndTagGrammar
+ rule end_tag
+ /*./
+ end
+ rule number
+ end_tag
+ end
+end

0 comments on commit 42381b0

Please sign in to comment.