2014-05-29 15:57:33 +03:00
|
|
|
module Parser
|
|
|
|
module ModuleDef
|
|
|
|
include Parslet
|
2014-05-30 10:42:43 +03:00
|
|
|
rule(:module_definition) do
|
2014-05-30 12:17:11 +03:00
|
|
|
keyword_module >> module_name >> eol >>
|
2014-05-29 15:57:33 +03:00
|
|
|
( (keyword_end.absent? >> root).repeat(1)).as(:module_expressions) >> keyword_end >> newline
|
|
|
|
end
|
2014-05-30 10:59:49 +03:00
|
|
|
|
|
|
|
rule(:class_definition) do
|
2014-05-30 12:17:11 +03:00
|
|
|
keyword_class >> module_name >> eol >>
|
2014-05-30 10:59:49 +03:00
|
|
|
( (keyword_end.absent? >> root).repeat(1)).as(:class_expressions) >> keyword_end >> newline
|
|
|
|
end
|
|
|
|
|
2014-05-29 15:57:33 +03:00
|
|
|
end
|
|
|
|
end
|