class Yadriggy::Command

A method call without parentheses.

Public Class Methods

new(sexp) click to toggle source
# File lib/yadriggy/ast.rb, line 970
def initialize(sexp)
  if sexp[0] == :command
    initialize_call([:call, nil, nil, sexp[1]])
    arg_exp = sexp[2]
  elsif sexp[0] == :command_call
    initialize_call([:call, sexp[1], sexp[2], sexp[3]])
    arg_exp = sexp[4]
  else
    raise "unknown pattern " + sexp.to_s
  end

  if arg_exp[0] == :args_add_block
    initialize_args(arg_exp)
  else
    @args = to_nodes(arg_exp)
    @block_arg = nil
    add_children(@args)
  end

  @block = nil
end
tags() click to toggle source
# File lib/yadriggy/ast.rb, line 968
def self.tags() [:command, :command_call] end

Public Instance Methods

accept(evaluator) click to toggle source

A method for Visitor pattern. @param [Eval] evaluator the visitor of Visitor pattern. @return [void]

# File lib/yadriggy/ast.rb, line 995
def accept(evaluator)
  evaluator.command(self)
end