Skip to content
Browse files

Better definition of super keyword

Fixes #36.
  • Loading branch information...
1 parent e362e8a commit aaac09b9a3d468c07d84d4b34aba09a1b20b8d1e @mjackson mjackson committed
Showing with 6 additions and 1 deletion.
  1. +2 −1 lib/citrus/file.rb
  2. +1 −0 test/_files/rule6.citrus
  3. +3 −0 test/_files/rule7.citrus
View
3 lib/citrus/file.rb
@@ -165,7 +165,7 @@ def value
end
rule :super do
- all('super', andp(" "), :space) {
+ ext(:super_keyword) {
Super.new
}
end
@@ -329,6 +329,7 @@ def value
rule :grammar_keyword, [ /\bgrammar\b/, :space ]
rule :root_keyword, [ /\broot\b/, :space ]
rule :rule_keyword, [ /\brule\b/, :space ]
+ rule :super_keyword, [ /\bsuper\b/, :space ]
rule :end_keyword, [ /\bend\b/, :space ]
rule :constant, /[A-Z][a-zA-Z0-9_]*/
View
1 test/_files/rule6.citrus
@@ -0,0 +1 @@
+rule super end
View
3 test/_files/rule7.citrus
@@ -0,0 +1,3 @@
+rule abc
+ "abc" | super
+end

0 comments on commit aaac09b

Please sign in to comment.
Something went wrong with that request. Please try again.