123456789_123456789_123456789_123456789_123456789_

Class: Ripper::SexpBuilderPP

Do not use. This class is for internal use only.
Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: Ripper::SexpBuilder
Defined in: ext/ripper/lib/ripper/sexp.rb

Constant Summary

::Ripper - Inherited

EVENTS, PARSER_EVENTS, SCANNER_EVENTS

Class Method Summary

::Ripper - Inherited

.lex

Tokenizes the Ruby program and returns an array of an array, which is formatted like [[lineno, column], type, token, state].

.parse

Parses the given Ruby program read from src.

.sexp
EXPERIMENTAL

Parses src and create S-exp tree.

.sexp_raw
EXPERIMENTAL

Parses src and create S-exp tree.

.slice
EXPERIMENTAL

Parses src and return a string which was matched to pattern.

.tokenize

Tokenizes the Ruby program and returns an array of strings.

.token_match

Instance Attribute Summary

SexpBuilder - Inherited

Instance Method Summary

SexpBuilder - Inherited

::Ripper - Inherited

#compile_error

This method is called when the parser found syntax error.

#warn

This method is called when weak warning is produced by the parser.

#warning

This method is called when strong warning is produced by the parser.

#_dispatch_0, #_dispatch_1, #_dispatch_2, #_dispatch_3, #_dispatch_4, #_dispatch_5, #_dispatch_6, #_dispatch_7

Instance Method Details

#_dispatch_event_new (private)

[ GitHub ]

  
# File 'ext/ripper/lib/ripper/sexp.rb', line 157

def _dispatch_event_new
  []
end

#_dispatch_event_push(list, item) (private)

[ GitHub ]

  
# File 'ext/ripper/lib/ripper/sexp.rb', line 161

def _dispatch_event_push(list, item)
  list.push item
  list
end

#on_heredoc_dedent(val, width) (private)

[ GitHub ]

  
# File 'ext/ripper/lib/ripper/sexp.rb', line 144

def on_heredoc_dedent(val, width)
  val.map! do |e|
    next e if Symbol === e and /_content\z/ =~ e
    if Array === e and e[0] == :@tstring_content
      e = dedent_element(e, width)
    elsif String === e
      dedent_string(e, width)
    end
    e
  end
  val
end

#on_mlhs_add_post(list, post) (private)

[ GitHub ]

  
# File 'ext/ripper/lib/ripper/sexp.rb', line 174

def on_mlhs_add_post(list, post)
  list.concat(post)
end

#on_mlhs_add_star(list, star) (private)

[ GitHub ]

  
# File 'ext/ripper/lib/ripper/sexp.rb', line 170

def on_mlhs_add_star(list, star)
  list.push([:rest_param, star])
end

#on_mlhs_paren(list) (private)

[ GitHub ]

  
# File 'ext/ripper/lib/ripper/sexp.rb', line 166

def on_mlhs_paren(list)
  [:mlhs, *list]
end