mirror of
https://github.com/samsonjs/compiler.git
synced 2026-03-25 08:45:52 +00:00
replace hardcoded variable sizes with the MachineBytes constant
This commit is contained in:
parent
3495c0450a
commit
f9acae7e15
1 changed files with 2 additions and 2 deletions
|
|
@ -205,7 +205,7 @@ module Assembler
|
||||||
end
|
end
|
||||||
|
|
||||||
# Define a variable with the given name and size in bytes.
|
# Define a variable with the given name and size in bytes.
|
||||||
def defvar(name, bytes=4)
|
def defvar(name, bytes=MachineBytes)
|
||||||
unless @symtab.var?(name)
|
unless @symtab.var?(name)
|
||||||
@symtab.defvar(name, bytes)
|
@symtab.defvar(name, bytes)
|
||||||
else
|
else
|
||||||
|
|
@ -235,7 +235,7 @@ module Assembler
|
||||||
end
|
end
|
||||||
|
|
||||||
# Define a variable unless it exists.
|
# Define a variable unless it exists.
|
||||||
def var!(name, bytes=4)
|
def var!(name, bytes=MachineBytes)
|
||||||
if var?(name)
|
if var?(name)
|
||||||
var(name)
|
var(name)
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue