Represents a hash pattern in pattern matching.
foo => { a: 1, b: 2 } ^^^^^^^^^^^^^^ foo => { a: 1, b: 2, **c } ^^^^^^^^^^^^^^^^^^^
Represents the use of the ‘if` keyword, either in the block form or the modifier form, or a ternary expression.
bar if foo ^^^^^^^^^^ if foo then bar end ^^^^^^^^^^^^^^^^^^^ foo ? bar : baz ^^^^^^^^^^^^^^^
Represents a node that is implicitly being added to the tree but doesn’t correspond directly to a node in the source.
{ foo: } ^^^^ { Foo: } ^^^^ foo in { bar: } ^^^^
Represents using a trailing comma to indicate an implicit rest parameter.
foo { |bar,| } ^ foo in [bar,] ^ for foo, in bar do end ^ foo, = bar ^
Represents the use of the ‘in` keyword in a case statement.
case a; in b then c end ^^^^^^^^^^^
Represents the use of the ‘&&=` operator on a call to the `[]` method.
foo.bar[baz] &&= value ^^^^^^^^^^^^^^^^^^^^^^
Represents the use of an assignment operator on a call to ‘[]`.
foo.bar[baz] += value ^^^^^^^^^^^^^^^^^^^^^
Represents the use of the ‘||=` operator on a call to `[]`.
foo.bar[baz] ||= value ^^^^^^^^^^^^^^^^^^^^^^
Represents assigning to an index.
foo[bar], = 1 ^^^^^^^^ begin rescue => foo[bar] ^^^^^^^^ end for foo[bar] in baz do end ^^^^^^^^
Represents a regular expression literal that contains interpolation that is being used in the predicate of a conditional to implicitly match against the last line read by an IO
object.
if /foo #{bar} baz/ then end ^^^^^^^^^^^^^^^^
Represents a string literal that contains interpolation.
"foo #{bar} baz" ^^^^^^^^^^^^^^^^
Represents a symbol literal that contains interpolation.
:"foo #{bar} baz" ^^^^^^^^^^^^^^^^^
Represents an xstring literal that contains interpolation.
`foo #{bar} baz` ^^^^^^^^^^^^^^^^
Represents an implicit set of parameters through the use of the ‘it` keyword within a block or lambda.
-> { it + it } ^^^^^^^^^^^^^^
Represents a keyword rest parameter to a method, block, or lambda definition.
def a(**b) ^^^ end
Represents using a lambda literal (not the lambda method call).
->(value) { value * 2 } ^^^^^^^^^^^^^^^^^^^^^^^
Represents a regular expression literal used in the predicate of a conditional to implicitly match against the last line read by an IO
object.
if /foo/i then end ^^^^^^
Represents writing local variables using a regular expression match with named capture groups.
/(?<foo>bar)/ =~ baz ^^^^^^^^^^^^^^^^^^^^
Represents a node that is missing from the source and results in a syntax error.