module RuboCop::AST::BuilderExtensions

def self.included(base)

def self.included(base)
  base.emit_forward_arg = true
  base.emit_match_pattern = true
end

def n(type, children, source_map)

Returns:
  • (Node) - the generated node
def n(type, children, source_map)
  node_klass(type).new(type, children, location: source_map)
end

def node_klass(type)

def node_klass(type)
  NODE_MAP[type] || Node
end

def string_value(token)

More details here https://github.com/whitequark/parser/issues/283
Overwrite the base method to allow strings with invalid encoding
def string_value(token)
  value(token)
end