fix locals scope in method and blocks

methods used to gobble up any locals of included scope. fixed
Blocks now create frame_type correctly and don't include and locals that are in fact method scope
This commit is contained in:
Torsten Ruger
2018-07-09 17:55:45 +03:00
parent 4ac89ece66
commit 06e78a7326
4 changed files with 24 additions and 7 deletions

View File

@ -47,8 +47,14 @@ module Vool
private
def make_frame
nodes = []
@body.each { |node| nodes << node }
nodes.dup.each do |node|
next unless node.is_a?(BlockStatement)
node.each {|block_scope| nodes.delete(block_scope)}
end
type_hash = {}
@body.each do |node|
nodes.each do |node|
next unless node.is_a?(LocalVariable) or node.is_a?(LocalAssignment)
type_hash[node.name] = :Object
end