fix register shortcuts
This commit is contained in:
parent
96972dab29
commit
91a0365c2e
@ -16,9 +16,6 @@ module Register
|
|||||||
"LoadConstant: #{register} <- #{constant_str}"
|
"LoadConstant: #{register} <- #{constant_str}"
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.load source , constant , register
|
|
||||||
LoadConstant.new source , constant , register
|
|
||||||
end
|
|
||||||
private
|
private
|
||||||
def constant_str
|
def constant_str
|
||||||
case @constant
|
case @constant
|
||||||
@ -33,4 +30,7 @@ module Register
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
def self.load_constant source , constant , register
|
||||||
|
LoadConstant.new source , constant , register
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@ -13,9 +13,9 @@ module Register
|
|||||||
"OperatorInstruction: #{left} #{operator} #{right}"
|
"OperatorInstruction: #{left} #{operator} #{right}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
end
|
||||||
def self.op source , operator , left , right
|
def self.op source , operator , left , right
|
||||||
OperatorInstruction.new source , operator , left , right
|
OperatorInstruction.new source , operator , left , right
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -28,9 +28,8 @@ module Register
|
|||||||
def to_s
|
def to_s
|
||||||
"RegisterTransfer: #{from} -> #{to}"
|
"RegisterTransfer: #{from} -> #{to}"
|
||||||
end
|
end
|
||||||
|
end
|
||||||
def self.transfer source , from , to
|
def self.transfer source , from , to
|
||||||
RegisterTransfer.new source , from , to
|
RegisterTransfer.new source , from , to
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user