Module: Fig::Grammar::V1Base::Command1

Defined in:
lib/fig/grammar/v1_base.rb

Instance Method Summary collapse

Instance Method Details

#gather_command_argument_nodes(node, arguments = []) ⇒ Object



900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
# File 'lib/fig/grammar/v1_base.rb', line 900

def gather_command_argument_nodes(node, arguments = [])
  if node.respond_to? 'quoted_or_bare_string?'
    arguments << node
    return arguments
  end

  return arguments if not node.elements

  node.elements.each do
    |element|
    gather_command_argument_nodes(element, arguments)
  end

  return arguments
end

#to_config_statement(build_state) ⇒ Object



894
895
896
897
898
# File 'lib/fig/grammar/v1_base.rb', line 894

def to_config_statement(build_state)
  return build_state.new_v1_command_statement(
    statement_start, gather_command_argument_nodes(command_line)
  )
end