Class: Mirah::AST::Ensure
- Defined in:
- lib/mirah/ast/flow.rb,
lib/mirah/compiler/flow.rb,
lib/mirah/jvm/source_generator/precompile.rb
Instance Attribute Summary collapse
-
#state ⇒ Object
Used by some compilers.
Attributes inherited from Node
#children, #inferred_type, #newline, #parent, #position
Instance Method Summary collapse
- #compile(compiler, expression) ⇒ Object
- #expr?(compiler) ⇒ Boolean
- #infer(typer, expression) ⇒ Object
-
#initialize(parent, position, &block) ⇒ Ensure
constructor
A new instance of Ensure.
Methods inherited from Node
#<<, ===, #[], #[]=, #_dump, _load, #_set_parent, child, child_name, #child_nodes, #each, #empty?, #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, &block) ⇒ Ensure
Returns a new instance of Ensure.
369 370 371 |
# File 'lib/mirah/ast/flow.rb', line 369 def initialize(parent, position, &block) super(parent, position, &block) end |
Instance Attribute Details
#state ⇒ Object
Used by some compilers.
367 368 369 |
# File 'lib/mirah/ast/flow.rb', line 367 def state @state end |
Instance Method Details
#compile(compiler, expression) ⇒ Object
101 102 103 104 105 106 |
# File 'lib/mirah/compiler/flow.rb', line 101 def compile(compiler, expression) compiler.line(line_number) compiler.ensure(self, expression) rescue Exception => ex raise Mirah::InternalCompilerError.wrap(ex, self) end |
#expr?(compiler) ⇒ Boolean
194 195 196 |
# File 'lib/mirah/jvm/source_generator/precompile.rb', line 194 def expr?(compiler) false end |
#infer(typer, expression) ⇒ Object
373 374 375 376 377 378 |
# File 'lib/mirah/ast/flow.rb', line 373 def infer(typer, expression) resolve_if(typer) do typer.infer(clause, false) typer.infer(body, false) end end |