rubyx/lib/parser/module_definition.rb
2014-05-30 10:59:49 +03:00

16 lines
418 B
Ruby

module Parser
module ModuleDef
include Parslet
rule(:module_definition) do
keyword_module >> name >> eol >>
( (keyword_end.absent? >> root).repeat(1)).as(:module_expressions) >> keyword_end >> newline
end
rule(:class_definition) do
keyword_class >> name >> eol >>
( (keyword_end.absent? >> root).repeat(1)).as(:class_expressions) >> keyword_end >> newline
end
end
end