Class: BiteScript::Bytecode::SmartLabel
- Inherits:
-
Object
- Object
- BiteScript::Bytecode::SmartLabel
- Defined in:
- lib/bitescript/bytecode.rb,
lib/bitescript/asm3/bytecode.rb
Instance Attribute Summary collapse
-
#label ⇒ Object
readonly
Returns the value of attribute label.
Instance Method Summary collapse
-
#initialize(method_visitor) ⇒ SmartLabel
constructor
A new instance of SmartLabel.
- #set! ⇒ Object
- #set? ⇒ Boolean
Constructor Details
#initialize(method_visitor) ⇒ SmartLabel
Returns a new instance of SmartLabel.
337 338 339 340 341 |
# File 'lib/bitescript/bytecode.rb', line 337 def initialize(method_visitor) @method_visitor = method_visitor @label = ASM::Label.new @set = false end |
Instance Attribute Details
#label ⇒ Object (readonly)
Returns the value of attribute label.
335 336 337 |
# File 'lib/bitescript/bytecode.rb', line 335 def label @label end |
Instance Method Details
#set! ⇒ Object
343 344 345 346 347 348 |
# File 'lib/bitescript/bytecode.rb', line 343 def set! raise "label set twice" if @set @set = true @method_visitor.visit_label(@label) self end |
#set? ⇒ Boolean
350 351 352 |
# File 'lib/bitescript/bytecode.rb', line 350 def set? @set end |