Class: BiteScript::Bytecode::SmartLabel

Inherits:
Object
  • Object
show all
Defined in:
lib/bitescript/bytecode.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(method_visitor) ⇒ SmartLabel

Returns a new instance of SmartLabel.



345
346
347
348
349
# File 'lib/bitescript/bytecode.rb', line 345

def initialize(method_visitor)
  @method_visitor = method_visitor
  @label = ASM::Label.new
  @set = false
end

Instance Attribute Details

#labelObject (readonly)

Returns the value of attribute label.



343
344
345
# File 'lib/bitescript/bytecode.rb', line 343

def label
  @label
end

Instance Method Details

#set!Object



351
352
353
354
355
356
# File 'lib/bitescript/bytecode.rb', line 351

def set!
  raise "label set twice" if @set
  @set = true
  @method_visitor.visit_label(@label)
  self
end

#set?Boolean

Returns:

  • (Boolean)


358
359
360
# File 'lib/bitescript/bytecode.rb', line 358

def set?
  @set
end