Class: Ripper::SexpBuilder
Do not use. This class is for internal use only.
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Subclasses:
|
|
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
::Ripper
|
|
Instance Chain:
self,
::Ripper
|
|
Inherits: |
Ripper
|
Defined in: | ext/ripper/lib/ripper/sexp.rb |
Constant Summary
::Ripper
- Inherited
Class Method Summary
::Ripper
- Inherited
.lex | Tokenizes the Ruby program and returns an array of an array, which is formatted like |
.parse | Parses the given Ruby program read from |
.sexp |
|
.sexp_raw |
|
.slice |
|
.tokenize | Tokenizes the Ruby program and returns an array of strings. |
.token_match |
Instance Attribute Summary
- #error readonly
Instance Method Summary
-
#compile_error(mesg)
private
Alias for #on_error.
- #dedent_element(e, width) private
- #on_error(mesg) (also: #on_parse_error, #compile_error) private
- #on_heredoc_dedent(val, width) private
-
#on_parse_error(mesg)
private
Alias for #on_error.
::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 Attribute Details
#error (readonly)
[ GitHub ]# File 'ext/ripper/lib/ripper/sexp.rb', line 84
attr_reader :error
Instance Method Details
#compile_error(mesg) (private)
Alias for #on_error.
# File 'ext/ripper/lib/ripper/sexp.rb', line 138
alias compile_error on_error
#dedent_element(e, width) (private)
[ GitHub ]# File 'ext/ripper/lib/ripper/sexp.rb', line 88
def dedent_element(e, width) if (n = dedent_string(e[1], width)) > 0 e[2][1] += n end e end
#on_error(mesg) (private) Also known as: #on_parse_error, #compile_error
[ GitHub ]# File 'ext/ripper/lib/ripper/sexp.rb', line 133
def on_error(mesg) @error = mesg end
#on_heredoc_dedent(val, width) (private)
[ GitHub ]# File 'ext/ripper/lib/ripper/sexp.rb', line 95
def on_heredoc_dedent(val, width) sub = proc do |cont| cont.map! do |e| if Array === e case e[0] when :@tstring_content e = dedent_element(e, width) when /_add\z/ e[1] = sub[e[1]] end elsif String === e dedent_string(e, width) end e end end sub[val] val end
#on_parse_error(mesg) (private)
Alias for #on_error.
# File 'ext/ripper/lib/ripper/sexp.rb', line 137
alias on_parse_error on_error