Class: Parser::Rewriter Deprecated
- Inherits:
-
AST::Processor
- Object
- AST::Processor
- Parser::Rewriter
- Extended by:
- Deprecation
- Defined in:
- sorbet/rbi/parser@3.3.7.4.rbi
Overview
Use TreeRewriter
Rewriter is deprecated. Use TreeRewriter instead. It has a backwards compatible API and uses Source::TreeRewriter instead of Source::Rewriter. Please check the documentation for Source::Rewriter for details.
source://parser//lib/parser/rewriter.rb#14
Constant Summary collapse
- DEPRECATION_WARNING =
source://parser//lib/parser/rewriter.rb#91
T.let(T.unsafe(nil), String)
Instance Method Summary collapse
-
#assignment?(node) ⇒ Boolean
Returns
true
if the specified node is an assignment node, returns false otherwise. -
#initialize(*_arg0) ⇒ Rewriter
constructor
source://parser//lib/parser/rewriter.rb#98.
-
#insert_after(range, content) ⇒ Object
Inserts new code after the given source range.
-
#insert_before(range, content) ⇒ Object
Inserts new code before the given source range.
-
#remove(range) ⇒ Object
Removes the source range.
-
#replace(range, content) ⇒ Object
Replaces the code of the source range
range
withcontent
. -
#rewrite(source_buffer, ast) ⇒ String
Rewrites the AST/source buffer and returns a String containing the new version.
-
#wrap(range, before, after) ⇒ Object
Wraps the given source range with the given values.
Methods included from Deprecation
warn_of_deprecation, warned_of_deprecation=
Methods inherited from AST::Processor
#on_alias, #on_and, #on_and_asgn, #on_arg_expr, #on_args, #on_argument, #on_array, #on_array_pattern, #on_array_pattern_with_tail, #on_begin, #on_block, #on_block_pass, #on_blockarg_expr, #on_break, #on_case, #on_case_match, #on_casgn, #on_class, #on_const, #on_const_pattern, #on_csend, #on_def, #on_defined?, #on_defs, #on_dstr, #on_dsym, #on_eflipflop, #on_empty_else, #on_ensure, #on_erange, #on_find_pattern, #on_for, #on_forwarded_kwrestarg, #on_forwarded_restarg, #on_hash, #on_hash_pattern, #on_if, #on_if_guard, #on_iflipflop, #on_in_match, #on_in_pattern, #on_index, #on_indexasgn, #on_irange, #on_kwargs, #on_kwbegin, #on_kwsplat, #on_lambda, #on_masgn, #on_match_alt, #on_match_as, #on_match_current_line, #on_match_pattern, #on_match_pattern_p, #on_match_rest, #on_match_with_lvasgn, #on_mlhs, #on_module, #on_next, #on_not, #on_numblock, #on_op_asgn, #on_or, #on_or_asgn, #on_pair, #on_pin, #on_postexe, #on_preexe, #on_procarg0, #on_redo, #on_regexp, #on_resbody, #on_rescue, #on_restarg_expr, #on_retry, #on_return, #on_sclass, #on_send, #on_splat, #on_super, #on_undef, #on_unless_guard, #on_until, #on_until_post, #on_var, #on_vasgn, #on_when, #on_while, #on_while_post, #on_xstr, #on_yield, #process_regular_node
Constructor Details
#initialize(*_arg0) ⇒ Rewriter
source://parser//lib/parser/rewriter.rb#98
3270 |
# File 'sorbet/rbi/parser@3.3.7.4.rbi', line 3270 def initialize(*_arg0); end |
Instance Method Details
#assignment?(node) ⇒ Boolean
Returns true
if the specified node is an assignment node, returns false
otherwise.
source://parser//lib/parser/rewriter.rb#38
3280 |
# File 'sorbet/rbi/parser@3.3.7.4.rbi', line 3280 def assignment?(node); end |
#insert_after(range, content) ⇒ Object
Inserts new code after the given source range.
source://parser//lib/parser/rewriter.rb#77
3289 |
# File 'sorbet/rbi/parser@3.3.7.4.rbi', line 3289 def insert_after(range, content); end |
#insert_before(range, content) ⇒ Object
Inserts new code before the given source range.
source://parser//lib/parser/rewriter.rb#67
3298 |
# File 'sorbet/rbi/parser@3.3.7.4.rbi', line 3298 def insert_before(range, content); end |
#remove(range) ⇒ Object
Removes the source range.
source://parser//lib/parser/rewriter.rb#47
3306 |
# File 'sorbet/rbi/parser@3.3.7.4.rbi', line 3306 def remove(range); end |
#replace(range, content) ⇒ Object
Replaces the code of the source range range
with content
.
source://parser//lib/parser/rewriter.rb#87
3315 |
# File 'sorbet/rbi/parser@3.3.7.4.rbi', line 3315 def replace(range, content); end |
#rewrite(source_buffer, ast) ⇒ String
Rewrites the AST/source buffer and returns a String containing the new version.
source://parser//lib/parser/rewriter.rb#23
3326 |
# File 'sorbet/rbi/parser@3.3.7.4.rbi', line 3326 def rewrite(source_buffer, ast); end |
#wrap(range, before, after) ⇒ Object
Wraps the given source range with the given values.
source://parser//lib/parser/rewriter.rb#57
3335 |
# File 'sorbet/rbi/parser@3.3.7.4.rbi', line 3335 def wrap(range, before, after); end |