Class: Mirah::AST::ClosureDefinition
- Inherits:
-
ClassDefinition
- Object
- Node
- ClassDefinition
- Mirah::AST::ClosureDefinition
- Defined in:
- lib/mirah/ast/class.rb,
lib/mirah/compiler/class.rb
Instance Attribute Summary collapse
-
#enclosing_type ⇒ Object
Returns the value of attribute enclosing_type.
Attributes inherited from ClassDefinition
#abstract, #current_access_level, #interfaces, #superclass
Attributes included from Scope
Attributes included from Named
Attributes included from Annotated
Attributes inherited from Node
#children, #inferred_type, #newline, #parent, #position
Instance Method Summary collapse
- #compile(compiler, expression) ⇒ Object
-
#initialize(parent, position, name, enclosing_type) ⇒ ClosureDefinition
constructor
A new instance of ClosureDefinition.
Methods inherited from ClassDefinition
#_define_method, #append_node, #declare_field, #define_constructor, #define_method, #define_static_method, #implements, #infer, #top_level?
Methods included from Scoped
Methods included from Named
#string_value, #to_s, #validate_name
Methods included from Annotated
Methods inherited from Node
#<<, ===, #[], #[]=, #_dump, _load, #_set_parent, child, child_name, #child_nodes, #each, #empty?, #expr?, #inferred_type!, #initialize_copy, #insert, #inspect, #inspect_children, #line_number, #log, #precompile, #resolve_if, #resolved!, #resolved?, #simple_name, #string_value, #temp, #to_s, #top_level?, #validate_child, #validate_children
Constructor Details
#initialize(parent, position, name, enclosing_type) ⇒ ClosureDefinition
Returns a new instance of ClosureDefinition.
174 175 176 177 178 179 |
# File 'lib/mirah/ast/class.rb', line 174 def initialize(parent, position, name, enclosing_type) super(parent, position, name, []) do [nil, nil] end @enclosing_type = enclosing_type end |
Instance Attribute Details
#enclosing_type ⇒ Object
Returns the value of attribute enclosing_type.
173 174 175 |
# File 'lib/mirah/ast/class.rb', line 173 def enclosing_type @enclosing_type end |
Instance Method Details
#compile(compiler, expression) ⇒ Object
27 28 29 30 31 |
# File 'lib/mirah/compiler/class.rb', line 27 def compile(compiler, expression) compiler.define_closure(self, expression) rescue Exception => ex raise Mirah::InternalCompilerError.wrap(ex, self) end |