Class: Prism::Translation::Ripper::SexpBuilderPP
Do not use. This class is for internal use only.
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
SexpBuilder,
Ripper
|
|
|
Instance Chain:
self,
SexpBuilder,
Ripper
|
|
| Inherits: |
Prism::Translation::Ripper::SexpBuilder
|
| Defined in: | lib/prism/translation/ripper/sexp.rb |
Overview
This class mirrors the ::Ripper::SexpBuilderPP subclass of Ripper that returns the same values as ::Ripper::SexpBuilder except with a couple of niceties that flatten linked lists into arrays.
Instance Attribute Summary
SexpBuilder - Inherited
Instance Method Summary
- #_dispatch_event_new private
- #_dispatch_event_push(list, item) private
- #on_heredoc_dedent(val, width) private
- #on_mlhs_add_post(list, post) private
- #on_mlhs_add_star(list, star) private
- #on_mlhs_paren(list) private
SexpBuilder - Inherited
| #compile_error | Alias for SexpBuilder#on_error. |
| #dedent_element, #on_error, #on_heredoc_dedent, | |
| #on_parse_error | Alias for SexpBuilder#on_error. |
Instance Method Details
#_dispatch_event_new (private)
[ GitHub ]# File 'lib/prism/translation/ripper/sexp.rb', line 87
def _dispatch_event_new [] end
#_dispatch_event_push(list, item) (private)
[ GitHub ]# File 'lib/prism/translation/ripper/sexp.rb', line 91
def _dispatch_event_push(list, item) list.push item list end
#on_heredoc_dedent(val, width) (private)
[ GitHub ]# File 'lib/prism/translation/ripper/sexp.rb', line 74
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 'lib/prism/translation/ripper/sexp.rb', line 104
def on_mlhs_add_post(list, post) list.concat(post) end
#on_mlhs_add_star(list, star) (private)
[ GitHub ]# File 'lib/prism/translation/ripper/sexp.rb', line 100
def on_mlhs_add_star(list, star) list.push([:rest_param, star]) end
#on_mlhs_paren(list) (private)
[ GitHub ]# File 'lib/prism/translation/ripper/sexp.rb', line 96
def on_mlhs_paren(list) [:mlhs, *list] end