Class: Unparser::Emitter::Send::Index::Assign
- Inherits:
-
Unparser::Emitter::Send::Index
- Object
- Unparser::Emitter
- Unparser::Emitter::Send
- Unparser::Emitter::Send::Index
- Unparser::Emitter::Send::Index::Assign
- Defined in:
- lib/unparser/emitter/send/index.rb
Overview
Emitter for assign to index nodes
Constant Summary
Constants inherited from Unparser::Emitter::Send
ASSIGN_SUFFIX, Unparser::Emitter::Send::INDEX_ASSIGN, Unparser::Emitter::Send::INDEX_PARENS, Unparser::Emitter::Send::INDEX_REFERENCE, NORMAL_PARENS
Constants inherited from Unparser::Emitter
CURLY_BRACKETS, DEFAULT_DELIMITER, NOINDENT, REGISTRY
Constants included from Constants
Constants::BINARY_OPERATORS, Constants::COMMENT, Constants::CURLY_BRACKETS, Constants::DBL_QUOTE, Constants::DEFAULT_DELIMITER, Constants::KEYWORDS, Constants::K_ALIAS, Constants::K_AND, Constants::K_BEGIN, Constants::K_BREAK, Constants::K_CASE, Constants::K_CLASS, Constants::K_DEF, Constants::K_DEFINE, Constants::K_DEFINED, Constants::K_DO, Constants::K_EEND, Constants::K_ELSE, Constants::K_ELSIF, Constants::K_ENCODING, Constants::K_END, Constants::K_ENSURE, Constants::K_FALSE, Constants::K_FILE, Constants::K_FOR, Constants::K_IF, Constants::K_IN, Constants::K_MODULE, Constants::K_NEXT, Constants::K_NIL, Constants::K_NOT, Constants::K_OR, Constants::K_POSTEXE, Constants::K_PREEXE, Constants::K_REDO, Constants::K_RESCUE, Constants::K_RETRY, Constants::K_RETURN, Constants::K_SELF, Constants::K_SUPER, Constants::K_THEN, Constants::K_TRUE, Constants::K_UNDEF, Constants::K_UNLESS, Constants::K_UNTIL, Constants::K_WHEN, Constants::K_WHILE, Constants::K_YIELD, Constants::M_PC, Constants::M_PO, Constants::NL, Constants::SNGL_QUOTE, Constants::TERMINATED, Constants::T_AMP, Constants::T_AND, Constants::T_ASN, Constants::T_ASR, Constants::T_COLON, Constants::T_DCL, Constants::T_DLT, Constants::T_DOT, Constants::T_DSPLAT, Constants::T_LT, Constants::T_NEG, Constants::T_OR, Constants::T_PIPE, Constants::T_SPLAT, Constants::UNARY_OPERATORS, Constants::WS
Instance Method Summary collapse
-
#emit_mlhs_operation ⇒ undefined
private
Emit mlhs arguments.
-
#emit_normal_operation ⇒ undefined
private
Emit normal arguments.
-
#emit_operation ⇒ undefined
private
Emit arguments.
-
#emit_regular_with_empty_args ⇒ undefined
private
Emit regular with empty ars.
Methods inherited from Unparser::Emitter::Send
Methods inherited from Unparser::Emitter
#dispatch, emit, emitter, #local_variable_scope, #local_variables, #node_type, #terminated?, #write_to_buffer
Methods included from NodeHelpers
Instance Method Details
#emit_mlhs_operation ⇒ undefined
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Emit mlhs arguments
80 81 82 83 84 |
# File 'lib/unparser/emitter/send/index.rb', line 80 def emit_mlhs_operation parentheses(*INDEX_PARENS) do delimited(arguments) end end |
#emit_normal_operation ⇒ undefined
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Emit normal arguments
92 93 94 95 96 97 98 |
# File 'lib/unparser/emitter/send/index.rb', line 92 def emit_normal_operation parentheses(*INDEX_PARENS) do delimited(indices) end write(WS, T_ASN, WS) visit(value) end |
#emit_operation ⇒ undefined
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Emit arguments
62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/unparser/emitter/send/index.rb', line 62 def emit_operation if arguments.empty? emit_regular_with_empty_args else if mlhs? emit_mlhs_operation else emit_normal_operation end end end |
#emit_regular_with_empty_args ⇒ undefined
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Emit regular with empty ars
106 107 108 |
# File 'lib/unparser/emitter/send/index.rb', line 106 def emit_regular_with_empty_args write(T_DOT, '[]=()') end |