Class: Duby::AST::Ensure
- Defined in:
- lib/duby/ast/flow.rb,
lib/duby/compiler.rb,
lib/duby/jvm/source_generator/precompile.rb
Instance Attribute Summary collapse
-
#state ⇒ Object
Used by the 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) ⇒ Object
-
#initialize(parent, position, &block) ⇒ Ensure
constructor
A new instance of Ensure.
Methods inherited from Node
#<<, ===, #[], #_set_parent, child, child_name, #each, #empty?, #initialize_copy, #insert, #inspect, #line_number, #log, #precompile, #resolve_if, #resolved!, #resolved?, #simple_name, #temp, #to_s
Constructor Details
#initialize(parent, position, &block) ⇒ Ensure
Returns a new instance of Ensure.
341 342 343 |
# File 'lib/duby/ast/flow.rb', line 341 def initialize(parent, position, &block) super(parent, position, &block) end |
Instance Attribute Details
#state ⇒ Object
Used by the some compilers.
339 340 341 |
# File 'lib/duby/ast/flow.rb', line 339 def state @state end |
Instance Method Details
#compile(compiler, expression) ⇒ Object
313 314 315 316 |
# File 'lib/duby/compiler.rb', line 313 def compile(compiler, expression) compiler.line(line_number) compiler.ensure(self, expression) end |
#expr?(compiler) ⇒ Boolean
170 171 172 |
# File 'lib/duby/jvm/source_generator/precompile.rb', line 170 def expr?(compiler) false end |
#infer(typer) ⇒ Object
345 346 347 348 349 350 |
# File 'lib/duby/ast/flow.rb', line 345 def infer(typer) resolve_if(typer) do typer.infer(clause) typer.infer(body) end end |