replace hardcoded variable sizes with the MachineBytes constant

This commit is contained in:
Sami Samhuri 2010-01-20 23:15:00 -08:00
parent 3495c0450a
commit f9acae7e15

View file

@ -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