Class: Type::UI32

Inherits:
Numeric show all
Defined in:
lib/rlang/parser/ext/type.rb

Constant Summary collapse

MAX =
2**32 - 1
MIN =
0

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Numeric

#type

Constructor Details

#initialize(v) ⇒ UI32

Returns a new instance of UI32.



38
# File 'lib/rlang/parser/ext/type.rb', line 38

def initialize(v); @v = Integer(v); end

Class Method Details

.signed?Boolean

Returns:

  • (Boolean)


40
# File 'lib/rlang/parser/ext/type.rb', line 40

def self.signed?; false; end

.sizeObject

size in bytes



42
# File 'lib/rlang/parser/ext/type.rb', line 42

def self.size; 4; end

.wasm_typeObject



44
# File 'lib/rlang/parser/ext/type.rb', line 44

def self.wasm_type; 'i32'; end

Instance Method Details

#+(v) ⇒ Object



39
# File 'lib/rlang/parser/ext/type.rb', line 39

def +(v); I32.new(v + @v); end

#sizeObject

size in bytes



41
# File 'lib/rlang/parser/ext/type.rb', line 41

def size; 4; end

#wasm_typeObject



43
# File 'lib/rlang/parser/ext/type.rb', line 43

def wasm_type; 'i32'; end