method stores constants
This commit is contained in:
parent
f08d9659fc
commit
66f5dcf152
@ -50,8 +50,9 @@ module Virtual
|
||||
@blocks = [enter]
|
||||
@current = enter
|
||||
new_block("return").add_code(MethodReturn.new)
|
||||
@constants = []
|
||||
end
|
||||
attr_reader :blocks
|
||||
attr_reader :blocks , :constants
|
||||
attr_accessor :return_type , :current , :receiver
|
||||
|
||||
# add an instruction after the current (insertion point)
|
||||
|
@ -73,6 +73,7 @@ module Virtual
|
||||
def self.compile_string expression , method
|
||||
value = expression.string.to_sym
|
||||
to = Return.new(Reference , value)
|
||||
method.info.constants << value
|
||||
method.info.add_code Set.new( to , value )
|
||||
to
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user