Method: Parser::Source::TreeRewriter#as_nested_actions
- Defined in:
- lib/parser/source/tree_rewriter.rb
#as_nested_actions ⇒ Array<(Symbol, Range, String{, String})>
Returns a representation of the rewriter as nested insertions (:wrap) and replacements.
rewriter.as_actions # =>[ [:wrap, 1...10, '(', ')'],
[:wrap, 2...6, '', '!'], # aka "insert_after"
[:replace, 2...4, 'foo'],
[:replace, 5...6, ''], # aka "removal"
],
Contrary to as_replacements, this representation is sufficient to recreate exactly
the rewriter.
299 300 301 |
# File 'lib/parser/source/tree_rewriter.rb', line 299 def as_nested_actions @action_root.nested_actions end |