Module: Unparser::NodeHelpers

Included in:
CLI::Source, Emitter, Preprocessor
Defined in:
lib/unparser/node_helpers.rb

Instance Method Summary collapse

Instance Method Details

#n(type, children = []) ⇒ Parser::AST::Node

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Helper for building nodes

Parameters:

  • (Symbol)

Returns:

  • (Parser::AST::Node)


26
27
28
# File 'lib/unparser/node_helpers.rb', line 26

def n(type, children = [])
  Parser::AST::Node.new(type, children)
end

#s(type, *children) ⇒ Parser::AST::Node

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Helper for building nodes

Parameters:

  • (Symbol)

Returns:

  • (Parser::AST::Node)


14
15
16
# File 'lib/unparser/node_helpers.rb', line 14

def s(type, *children)
  Parser::AST::Node.new(type, children)
end