Skip to content

Commit 7d25f7b

Browse files
committed
minor
1 parent 6743ec7 commit 7d25f7b

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

lib/rubex/ast/top_statement/klass/attached_klass.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def write_alloc_c_function(code)
131131
# TODO: modify for supporting inheritance
132132
def member_struct_allocations
133133
c_name = @scope.find(@attached_type).c_name
134-
binding.pry
134+
#binding.pry
135135
"data->#{Rubex::POINTER_PREFIX + @attached_type} = (#{c_name}*)xmalloc(sizeof(#{c_name}));\n"
136136
end
137137

lib/rubex/symbol_table/scope.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,14 @@ def initialize name, outer_scope
270270
def upgrade_symbols_to_global
271271
@block_entries.uniq!
272272
@block_entries.each do |entry|
273-
entry.c_name = Rubex::GLOBAL_PREFIX + @name + entry.c_name
274273
@outer_scope.global_entries << entry
275274
end
276275

277276
remove_global_from_local_entries
277+
278+
@outer_scope.global_entries.each do |entry|
279+
entry.c_name = Rubex::GLOBAL_PREFIX + @name + entry.c_name
280+
end
278281
end
279282

280283
# IMPORTANT NOTE TO PROGRAMMER:
@@ -306,7 +309,7 @@ def upgrade_symbols_to_global
306309
# of @outer_scope get carried forward into this begin block callback.
307310
# Therefore these variables get declared inside the begin block callback
308311
# as well. So whenever one of these Arrays is called for this particular
309-
# scope, we return an empty array so that nothing gets declared.
312+
# scope, we preturn an empty array so that nothing gets declared.
310313
def method_missing meth, *args, &block
311314
return [] if meth == :var_entries
312315
ret = @outer_scope.send(meth, *args, &block)

0 commit comments

Comments
 (0)