Class: Ripper

Inherits:
Object show all
Defined in:
lib/ripper/ruby_builder.rb,
lib/ripper/event_log.rb,
lib/ripper/ruby_builder/queue.rb,
lib/ripper/ruby_builder/stack.rb,
lib/ripper/ruby_builder/token.rb,
lib/ripper/ruby_builder/buffer.rb,
lib/ripper/ruby_builder/events/if.rb,
lib/ripper/ruby_builder/events/for.rb,
lib/ripper/ruby_builder/events/args.rb,
lib/ripper/ruby_builder/events/call.rb,
lib/ripper/ruby_builder/events/case.rb,
lib/ripper/ruby_builder/events/hash.rb,
lib/ripper/ruby_builder/events/array.rb,
lib/ripper/ruby_builder/events/block.rb,
lib/ripper/ruby_builder/events/const.rb,
lib/ripper/ruby_builder/events/lexer.rb,
lib/ripper/ruby_builder/events/while.rb,
lib/ripper/ruby_builder/events/method.rb,
lib/ripper/ruby_builder/events/string.rb,
lib/ripper/ruby_builder/events/symbol.rb,
lib/ripper/ruby_builder/events/literal.rb,
lib/ripper/ruby_builder/events/operator.rb,
lib/ripper/ruby_builder/events/assignment.rb,
lib/ripper/ruby_builder/events/identifier.rb,
lib/ripper/ruby_builder/events/statements.rb

Overview

When tokens are pushed to the stack they may first be buffered when they belong to the Prolog part of a Ruby::Node. Buffered tokens will then be aggregated to the Prolog of the next token that is not buffered. Tokens belonging to the Prolog part of a Ruby::Node are whitespace, separator and heredoc tokens.

E.g. when a whitespace char (“ ”) is pushed to the stack it will be buffered. Then when an :@ident token is pushed to the stack the contents of the buffer will be assigned to the Prolog of the :@ident token. Thus the whitespace char ends up in the Prolog of the :@ident token.

Defined Under Namespace

Classes: EventLog, RubyBuilder