fixes from the method argument change

Affects
method creation
argument manipulation
compiler / to_code
This commit is contained in:
Torsten Ruger
2016-12-13 18:49:45 +02:00
parent 2c5541fb19
commit 16b3a77350
8 changed files with 26 additions and 25 deletions

View File

@ -25,15 +25,21 @@ module Typed
w = Tree::FunctionStatement.new()
w.return_type = return_type
w.name = name.children.first
w.parameters = parameters.to_a.collect do |p|
raise "error, argument must be a identifier, not #{p}" unless p.type == :parameter
p.children
end
w.parameters = process parameters
w.statements = process(statements)
w.receiver = receiver
w
end
def on_parameters statement
params = {}
statement.children.each do |param , type , name|
type , name = *param
params[name] = type
end
params
end
def on_field_def statement
type , name , value = *statement
w = Tree::FieldDef.new()