486e24514b
it was ruby after all should be reborn as twins: namespace and aspect
17 lines
499 B
Ruby
17 lines
499 B
Ruby
module Parser
|
|
module FunctionDefinition
|
|
include Parslet
|
|
|
|
rule(:function_definition) {
|
|
type >> ((class_name|name).as(:receiver) >> str(".")).maybe >> #possibly qualified
|
|
name.as(:function_name) >> left_parenthesis >>
|
|
parameter_list.maybe >> right_parenthesis >> expressions_end >> space?
|
|
}
|
|
|
|
rule(:parameter_list) {
|
|
((field.as(:parameter) >> (comma >> field.as(:parameter)).repeat(0)).repeat(0,1)).as(:parameter_list)
|
|
}
|
|
|
|
end
|
|
end
|