Class: Y2R::AST::YCP::Bracket

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

Instance Method Summary collapse

Methods inherited from Node

#always_returns?, #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

#compile(context) ⇒ Object



837
838
839
840
841
842
843
844
845
846
847
848
849
# File 'lib/y2r/ast/ycp.rb', line 837

def compile(context)
  Ruby::MethodCall.new(
    :receiver => Ruby::Variable.new(:name => "Ops"),
    :name     => "set",
    :args     => [
      entry.compile(context),
      build_index(context),
      rhs.compile(context),
    ],
    :block    => nil,
    :parens   => true
  )
end