change the ruby block to be like the ruby block
ie modelled like the ast outputs it
This commit is contained in:
@ -1,12 +1,11 @@
|
||||
module Vool
|
||||
module Ruby
|
||||
|
||||
class BlockStatement < Statement
|
||||
attr_reader :args , :body , :clazz
|
||||
attr_reader :send , :args , :body
|
||||
|
||||
def initialize( args , body , something_really_else)
|
||||
@args , @body = args , body
|
||||
def initialize( send , args , body )
|
||||
@send , @args , @body = send , args , body
|
||||
raise "no bod" unless @body
|
||||
@clazz = clazz
|
||||
end
|
||||
|
||||
def to_vool
|
||||
|
@ -41,8 +41,7 @@ module Ruby
|
||||
sendd = process(block_node.children[0])
|
||||
args = process(block_node.children[1])
|
||||
body = process(block_node.children[2])
|
||||
sendd.add_block BlockStatement.new(args , body)
|
||||
sendd
|
||||
BlockStatement.new(sendd , args , body)
|
||||
end
|
||||
|
||||
def on_yield(node)
|
||||
@ -177,7 +176,7 @@ module Ruby
|
||||
IfStatement.new( process(condition) , if_true , if_false )
|
||||
end
|
||||
|
||||
def on_send statement
|
||||
def on_send( statement )
|
||||
kids = statement.children.dup
|
||||
receiver = process(kids.shift) || SelfExpression.new
|
||||
name = kids.shift
|
||||
|
Reference in New Issue
Block a user