Class: WAG::Instruction::F32::Const

Inherits:
Object
  • Object
show all
Includes:
WAG::Instructable
Defined in:
lib/wag/instructions/f32/const.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from WAG::Instructable

#f32, #f64, #i32, #i64, #local, #memory

Constructor Details

#initialize(literal) ⇒ Const

Returns a new instance of Const.



10
11
12
13
# File 'lib/wag/instructions/f32/const.rb', line 10

def initialize(literal)
  @literal = literal.to_f
  super()
end

Instance Attribute Details

#literalObject (readonly)

Returns the value of attribute literal.



8
9
10
# File 'lib/wag/instructions/f32/const.rb', line 8

def literal
  @literal
end

Instance Method Details

#to_sexprObject



15
16
17
# File 'lib/wag/instructions/f32/const.rb', line 15

def to_sexpr
  [name, @literal]
end