123456789_123456789_123456789_123456789_123456789_

Class: RuboCop::AST::Builder

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Parser::Builders::Default
Instance Chain:
self, BuilderExtensions, Parser::Builders::Default
Inherits: Parser::Builders::Default
  • Object
Defined in: lib/rubocop/ast/builder.rb

Overview

Builder is an AST builder that is utilized to let Parser generate ASTs with Node.

Examples:

buffer = Parser::Source::Buffer.new('(string)')
buffer.source = 'puts :foo'

builder = RuboCop::AST::Builder.new
require 'parser/ruby25'
parser = Parser::Ruby25.new(builder)
root_node = parser.parse(buffer)

Constant Summary

BuilderExtensions - Included

NODE_MAP

Instance Method Summary

BuilderExtensions - Included

#n

Generates Node from the given information.

#string_value

Overwrite the base method to allow strings with invalid encoding More details here https://github.com/whitequark/parser/issues/283.

#node_klass