Class: Chelsy::Labeled

Inherits:
Stmt show all
Defined in:
lib/chelsy/ast.rb

Overview

== 6.8.1 Labeled statements

Direct Known Subclasses

Case

Instance Attribute Summary collapse

Attributes inherited from Element

#fragments, #post_fragments

Instance Method Summary collapse

Constructor Details

#initialize(label, stmt, **rest) ⇒ Labeled

Returns a new instance of Labeled.



943
944
945
946
947
# File 'lib/chelsy/ast.rb', line 943

def initialize(label, stmt, **rest)
  @label = Syntax::Ident.ensure(label)
  @stmt = Syntax::Stmt.ensure(stmt)
  super **rest
end

Instance Attribute Details

#labelObject (readonly)

Returns the value of attribute label.



941
942
943
# File 'lib/chelsy/ast.rb', line 941

def label
  @label
end

#stmtObject (readonly)

Returns the value of attribute stmt.



941
942
943
# File 'lib/chelsy/ast.rb', line 941

def stmt
  @stmt
end