Class: Internal::ByteDecoder::Expression::Literal

Inherits:
Internal::ByteDecoder::Expression show all
Defined in:
lib/internal/vm/bytedecoder.rb

Instance Attribute Summary collapse

Attributes inherited from Internal::ByteDecoder::Expression

#pc

Instance Method Summary collapse

Methods inherited from Internal::ByteDecoder::Expression

#<=>, #fmt

Constructor Details

#initialize(pc, value) ⇒ Literal

Returns a new instance of Literal.



81
82
83
84
# File 'lib/internal/vm/bytedecoder.rb', line 81

def initialize(pc, value)
  super(pc)
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



79
80
81
# File 'lib/internal/vm/bytedecoder.rb', line 79

def value
  @value
end

Instance Method Details

#precedenceObject



93
94
95
# File 'lib/internal/vm/bytedecoder.rb', line 93

def precedence
  return 1
end

#to_sObject



86
87
88
89
90
91
# File 'lib/internal/vm/bytedecoder.rb', line 86

def to_s
  case @value
  when Regexp then "/#{@value.inspect[1..-2]}/"
  else; return @value.inspect
  end
end