Class: Riml::AST_Rewriter::DefaultParamToIfNode::SplatVarToCopiedSplatVar
- Inherits:
-
Riml::AST_Rewriter
- Object
- Riml::AST_Rewriter
- Riml::AST_Rewriter::DefaultParamToIfNode::SplatVarToCopiedSplatVar
- Defined in:
- lib/riml/ast_rewriter.rb
Overview
rewrites a:000 or args (if function used *args parameter name) to:
__splat_var_cpy
Constant Summary
Constants included from Constants
Constants::BUILTIN_COMMANDS, Constants::BUILTIN_FUNCTIONS, Constants::COMPARISON_OPERATORS, Constants::COMPILED_STRING_LOCATION, Constants::DEFINE_KEYWORDS, Constants::END_KEYWORDS, Constants::IGNORECASE_CAPABLE_OPERATORS, Constants::KEYWORDS, Constants::REGISTERS, Constants::RIML_CLASS_COMMANDS, Constants::RIML_COMMANDS, Constants::RIML_END_KEYWORDS, Constants::RIML_FILE_COMMANDS, Constants::RIML_KEYWORDS, Constants::SPECIAL_VARIABLE_PREFIXES, Constants::SPLAT_LITERAL, Constants::UNKNOWN_LOCATION_INFO, Constants::VIML_COMMANDS, Constants::VIML_END_KEYWORDS, Constants::VIML_KEYWORDS
Instance Attribute Summary
Attributes inherited from Riml::AST_Rewriter
Instance Method Summary collapse
-
#initialize(def_node, classes) ⇒ SplatVarToCopiedSplatVar
constructor
A new instance of SplatVarToCopiedSplatVar.
- #match?(node) ⇒ Boolean
- #replace(node) ⇒ Object
Methods inherited from Riml::AST_Rewriter
#add_SID_function!, #add_SID_function?, #do_establish_parents, #do_rewrite_on_match, #establish_parents, #max_recursion_lvl, #reorder_includes_based_on_class_dependencies!, #resolve_class_dependencies!, #resolve_class_dependencies?, #rewrite, #rewrite_included_and_sourced_files!, #rewrite_on_match, #watch_for_class_pickup
Constructor Details
#initialize(def_node, classes) ⇒ SplatVarToCopiedSplatVar
Returns a new instance of SplatVarToCopiedSplatVar.
958 959 960 |
# File 'lib/riml/ast_rewriter.rb', line 958 def initialize(def_node, classes) super(def_node, classes) end |
Instance Method Details
#match?(node) ⇒ Boolean
962 963 964 965 |
# File 'lib/riml/ast_rewriter.rb', line 962 def match?(node) GetVariableNode === node && ( (node.name == '000' && node.scope_modifier.nil?) || ast.is_splat_arg?(node) ) end |
#replace(node) ⇒ Object
967 968 969 |
# File 'lib/riml/ast_rewriter.rb', line 967 def replace(node) node.name = '__splat_var_cpy' end |