Class: Y2R::AST::YCP::StmtBlock

Inherits:
Node
  • Object
show all
Defined in:
lib/y2r/ast/ycp.rb

Instance Method Summary collapse

Methods inherited from Node

#compile_as_copy_if_needed, #compile_statements, #compile_statements_inside_block, #compile_statements_with_whitespace, #creates_local_scope?, #needs_copy?, #never_nil?, #optimize_last_statement, #optimize_next, #optimize_return, #remove_duplicate_imports, transfers_comments

Instance Method Details

#always_returns?Boolean

Returns:

  • (Boolean)


1812
1813
1814
# File 'lib/y2r/ast/ycp.rb', line 1812

def always_returns?
  statements.any? { |s| s.always_returns? }
end

#compile(context) ⇒ Object



1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
# File 'lib/y2r/ast/ycp.rb', line 1801

def compile(context)
  context.inside self do |inner_context|
    Ruby::Statements.new(
      :statements => compile_statements_with_whitespace(
        statements,
        inner_context
      )
    )
  end
end