Module lib_ruby_parser::nodes
source · [−]Expand description
Module with all known node types
Structs
Represents
alias to from
statement.Represents
foo && bar
(or foo and bar
) statement.Represents
a &&= 1
statement.Represents a positional required block/method argument.
Represents an arguments list
Represents an array literal
Represents an array pattern used in pattern matching
Represents an array pattern with trailing comma used in pattern matching
Represents special global variables:
Represents compound statement (i.e. a multi-statement)
Represents a Ruby block that is passed to a method (
proc { |foo| bar }
)Represents a
&blk
argument of the method call (but not of the method definition, see BlockArg
)Represents a
&blk
argument in the method definition (but not in the method call, see BlockPass
)Represents a
break
keyword (with optional argument)Represents conditional method call using
&.
operatorRepresents a
case
statement (for pattern matching see CaseMatch
node)Represents a
case
statement used for pattern matching (for regular case
see Case
node)Represents a constant assignment (i.e.
A = 1
)Represents leading
::
part of the constant access/assignment that is used to get/set on a global namespace.Represents a class definition (using a
class
keyword, Class.new
is just a method call)Represents a
Complex
literal (that returns an Complex
number)Represents constant access (i.e.
Foo::Bar
)Const pattern used in pattern matching (e.g.
in A(1, 2)
)Represents access to class variable (i.e.
@@var
)Represents class variable assignment (i.e.
@@var = 42
)Represents method definition using
def
keyword (not on a singleton, see Defs
node).Represents a
defined?(foo)
expressionRepresents a singleton method definition (i.e.
def self.foo; end
)Represents a string with interpolation (i.e.
"#{foo}"
)Represents a symbol with interpolation (i.e.
:"#{foo}"
)Represents exclusive flip-flop (i.e. in
if foo...bar; end
)Represents a special empty else that is a part of the pattern matching.
Represents a special
__ENCODING__
keywordRepresents a block of code with
ensure
(i.e. begin; ensure; end
)Represents range literal with excluded
end
(i.e. 1...3
)Represents a
false
literalRepresents a special
__FILE__
literalRepresents a find pattern using in pattern matching (i.e.
in [*x, 1 => a, *y]
)Represents a float literal (i.e.
42.5
)Represents a
for
loopRepresents a special
...
argument that forwards positional/keyword/block arguments.Represents a
...
operator that contains forwarded argument (see ForwardArg
)Represents access to global variable (i.e.
$foo
)Represents global variable assignment (i.e.
$foo = 42
)Represents a hash literal (i.e.
{ foo: 42 }
)Represents a hash pattern used in pattern matching (i.e.
in { a: 1 }
)Represents a here-document literal (both with and without interpolation)
Represents inclusive flip-flop (i.e. in
if foo..bar; end
)Represents an
if
statement (i.e. if foo; bar; else; baz; end
)Represents an
if
guard used in pattern matching (i.e. case foo; in pattern if guard; end
)Represents an
if
/unless
modifier (i.e. stmt if cond
)Represents ternary
if
statement (i.e. cond ? if_true : if_false
)Represents an
in pattern
branch of the pattern matchingRepresents indexing operation (i.e.
foo[1,2,3]
)Represents assignment using indexing operation (i.e.
foo[1, 2, 3] = bar
)Represents an integer literal (i.e.
42
)Represents inclusive range (i.e.
2..4
)Represents access to instance variable (i.e.
@foo
)Represents instance variable assignment (i.e
@foo = 42
)Represents an explicit
begin; end
block.Represents required keyword argument (i.e.
foo
in def m(foo:); end
)Represents kwargs that are given to a method call, super or yield (i.e.
foo(bar: 1)
)Represents an special argument that rejects all keyword arguments (i.e.
def m(**nil); end
)Represents an optional keyword argument (i.e.
foo
in def m(foo: 42); end
)Represents a keyword rest argument (i.e.
foo
in def m(**foo); end
)Represents a keyword arguments splat (i.e.
**bar
in a call like foo(**bar)
)Represents a lambda call using
->
(i.e. -> {}
)Represents a special
__LINE__
literalRepresents access to a local variable (i.e.
foo
)Represents local variable assignment (i.e.
foo = 42
)Represents mass-assignment (i.e.
foo, bar = 1, 2
)Represents pattern matching using one of the given patterns (i.e.
foo in 1 | 2
)Represents matching with renaming into specified local variable (i.e.
case 1; in Integer => a; end
)Represents implicit matching using
if /regex/
Represents empty hash pattern that is used in pattern matching (i.e.
in **nil
)Represents a one-line pattern matching that can throw an error (i.e.
foo => pattern
)Represents a one-line pattern matching that never throws but returns true/false (i.e.
foo in pattern
)Represents a wildcard pattern used in pattern matching (i.e.
in *foo
)Represents matching with assignment into a local variable (i.e.
pattern => var
)Represents matching a regex that produces local variables (i.e.
/(?<match>bar)/ =~ 'bar'
)Represents left hand statement of the mass-assignment (i.e.
foo, bar
in foo, bar = 1, 2
)Represents module declaration using
module
keywordRepresents
next
keywordRepresents
nil
literalRepresents numeric global variable (e.g.
$1
)Represents a block that takes numbered parameters (i.e.
proc { _1 }
)Represents an operation with assignment (e.g.
a += 1
)Represents optional positional argument (i.e.
foo
in m(foo = 1)
)Represents
foo || bar
(or foo or bar
) statement.Represents
lhs ||= rhs
assignmentRepresents a key/value pair (e.g. a part of the
Hash
node)Represents a pattern based on a “pinned” variable (e.g.
^foo
)Represents
END { .. }
statementRepresents
BEGIN { ... }
statementRepresents a sole block argument (e.g.
|foo|
)Represents rational literal (e.g.
1r
)Represents
redo
keywordRepresents flags of the regex literal (i.e.
mix
for /foo/mix
)Represents regex literal (e.g.
/foo/
)Represents a
rescue
blockRepresents a single
rescue
handler (i.e. rescue E => e ...
)Represents positional rest argument (i.e.
*foo
in def m(*foo); end
)Represents
retry
keywordRepresents
return
keywordRepresents opening a singleton class (i.e.
class << foo; ... end;
)Represents
self
keywordRepresents a method call (e.g.
foo.bar(42)
)Represents a special block argument that “shadows” outer variable (i.e.
|;foo|
)Represents an arguments splat (i.e.
*bar
in a call like foo(*bar)
)Represents a plain non-interpolated string literal (e.g.
"foo"
)Represents a
super
keywordRepresents a plain symbol literal (i.e.
:foo
)Represents a
true
literalRepresents an
undef
keyword (e.g. undef foo, :bar
)Represents an
unless
guard used in pattern matching (i.e. in pattern unless guard
)Represents
until
loopRepresents a post-until loop
Represents a branch of the
case
statement (i.e. when foo
)Represents
while
loopRepresents a post-while loop
Represents a executable here-document literal (both with and without interpolation)
Represents an executable string (i.e.
`sh #{script_name}`
)Represents an
yield
keywordRepresents a
super
call without arguments and parenthesesEnums
Generic combination of all known nodes.