Class: WAG::Local

Inherits:
Object
  • Object
show all
Includes:
Encodable
Defined in:
lib/wag/local.rb

Overview

Local is not an instruction, but a nested keyword.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Encodable

#to_wasm, #to_wat

Constructor Details

#initialize(label, type) ⇒ Local

Returns a new instance of Local.



10
11
12
13
# File 'lib/wag/local.rb', line 10

def initialize(label, type)
  @label = WAG::Label.from(label)
  @type = WAG::Type.from(type)
end

Instance Attribute Details

#labelObject (readonly)

Returns the value of attribute label.



8
9
10
# File 'lib/wag/local.rb', line 8

def label
  @label
end

#typeObject (readonly)

Returns the value of attribute type.



8
9
10
# File 'lib/wag/local.rb', line 8

def type
  @type
end

Instance Method Details

#to_sexprObject



15
16
17
# File 'lib/wag/local.rb', line 15

def to_sexpr
  [:local, label.to_sexpr, type.to_sexpr]
end