module WAG::Instructable

Public Instance Methods

f32() click to toggle source
# File lib/wag/instructable.rb, line 24
def f32
  WAG::F32Instructions.new(instructions)
end
f64() click to toggle source
# File lib/wag/instructable.rb, line 28
def f64
  WAG::F64Instructions.new(instructions)
end
i32() click to toggle source
# File lib/wag/instructable.rb, line 40
def i32
  WAG::I32Instructions.new(instructions)
end
i64() click to toggle source
# File lib/wag/instructable.rb, line 44
def i64
  WAG::I64Instructions.new(instructions)
end
local(*args) click to toggle source
# File lib/wag/instructable.rb, line 32
def local(*args)
  return WAG::LocalInstructions.new(instructions) if args.empty?

  instruction = WAG::Local.new(*args)
  instructions << instruction
  instruction
end
memory() click to toggle source
# File lib/wag/instructable.rb, line 48
def memory
  WAG::MemoryInstructions.new(instructions)
end
to_sexpr() click to toggle source
Calls superclass method
# File lib/wag/instructable.rb, line 52
def to_sexpr
  value = super()
  return value if instructions.empty?

  Array(value).concat(instructions.map(&:to_sexpr))
end

Private Instance Methods

instructions() click to toggle source
# File lib/wag/instructable.rb, line 61
def instructions
  @instructions ||= []
end