Add ruby class methods

Ruby parser and ruby level for #24
This commit is contained in:
Torsten Ruger
2019-02-12 22:36:37 +02:00
parent 403540b3ca
commit 37571a0ff9
5 changed files with 39 additions and 1 deletions

View File

@ -54,6 +54,13 @@ module Ruby
MethodStatement.new( name , arg_array , process(body) )
end
def on_defs( statement )
me , name , args , body = *statement
raise "only class method implemented, not #{me.type}" unless me.type == :self
arg_array = process_all( args )
ClassMethodStatement.new( name , arg_array , process(body) )
end
def on_arg( arg )
arg.first
end