2014-06-04 18:55:04 +02:00
|
|
|
module Parser
|
|
|
|
module ModuleDef
|
|
|
|
include Parslet
|
|
|
|
rule(:module_definition) do
|
2015-09-15 17:57:31 +02:00
|
|
|
keyword_module >> module_name >>
|
|
|
|
( (keyword_end.absent? >> root_body).repeat()).as(:module_expressions) >> keyword_end
|
2014-06-04 18:55:04 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
rule(:class_definition) do
|
2015-09-15 17:57:31 +02:00
|
|
|
keyword_class >> module_name >> (smaller >> module_name).maybe.as(:derived_name) >>
|
|
|
|
( (keyword_end.absent? >> root_body).repeat()).as(:class_expressions) >> keyword_end
|
2014-06-04 18:55:04 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|