renamed parser rules for clarity. fixed

This commit is contained in:
Torsten Ruger
2014-04-27 21:12:42 +03:00
parent 583e6f0c9f
commit 408cf98ea5
6 changed files with 88 additions and 72 deletions

View File

@ -64,9 +64,9 @@ module Vm
end
class FunctionExpression < Expression
attr_reader :name, :params, :body
def initialize name, params, body
@name, @params, @body = name, params, body
attr_reader :name, :params, :block
def initialize name, params, block
@name, @params, @block = name, params, block
end
def eval(context, builder)
param_names = [params].flatten.map(&:name)
@ -74,7 +74,7 @@ module Vm
types = [builder.int] * (param_names.count + 1)
builder.public_static_method(self.name, [], *types) do |method|
self.body.eval(context, method)
self.block.eval(context, method)
method.ireturn
end
end