Expand description
Module with all known node types
Modules§
Structs§
- Alias
- Represents
alias to from
statement. - And
- Represents
foo && bar
(orfoo and bar
) statement. - AndAsgn
- Represents
a &&= 1
statement. - Arg
- Represents a positional required block/method argument.
- Args
- Represents an arguments list
- Array
- Represents an array literal
- Array
Pattern - Represents an array pattern used in pattern matching
- Array
Pattern With Tail - Represents an array pattern with trailing comma used in pattern matching
- BackRef
- Represents special global variables:
- Begin
- Represents compound statement (i.e. a multi-statement)
- Block
- Represents a Ruby block that is passed to a method (
proc { |foo| bar }
) - Block
Pass - Represents a
&blk
argument of the method call (but not of the method definition, seeBlockArg
) - Blockarg
- Represents a
&blk
argument in the method definition (but not in the method call, seeBlockPass
) - Break
- Represents a
break
keyword (with optional argument) - CSend
- Represents conditional method call using
&.
operator - Case
- Represents a
case
statement (for pattern matching seeCaseMatch
node) - Case
Match - Represents a
case
statement used for pattern matching (for regularcase
seeCase
node) - Casgn
- Represents a constant assignment (i.e.
A = 1
) - Cbase
- Represents leading
::
part of the constant access/assignment that is used to get/set on a global namespace. - Class
- Represents a class definition (using a
class
keyword,Class.new
is just a method call) - Complex
- Represents a
Complex
literal (that returns anComplex
number) - Const
- Represents constant access (i.e.
Foo::Bar
) - Const
Pattern - Const pattern used in pattern matching (e.g.
in A(1, 2)
) - Cvar
- Represents access to class variable (i.e.
@@var
) - Cvasgn
- Represents class variable assignment (i.e.
@@var = 42
) - Def
- Represents method definition using
def
keyword (not on a singleton, seeDefs
node). - Defined
- Represents a
defined?(foo)
expression - Defs
- Represents a singleton method definition (i.e.
def self.foo; end
) - Dstr
- Represents a string with interpolation (i.e.
"#{foo}"
) - Dsym
- Represents a symbol with interpolation (i.e.
:"#{foo}"
) - EFlip
Flop - Represents exclusive flip-flop (i.e. in
if foo...bar; end
) - Empty
Else - Represents a special empty else that is a part of the pattern matching.
- Encoding
- Represents a special
__ENCODING__
keyword - Ensure
- Represents a block of code with
ensure
(i.e.begin; ensure; end
) - Erange
- Represents range literal with excluded
end
(i.e.1...3
) - False
- Represents a
false
literal - File
- Represents a special
__FILE__
literal - Find
Pattern - Represents a find pattern using in pattern matching (i.e.
in [*x, 1 => a, *y]
) - Float
- Represents a float literal (i.e.
42.5
) - For
- Represents a
for
loop - Forward
Arg - Represents a special
...
argument that forwards positional/keyword/block arguments. - Forwarded
Args - Represents a
...
operator that contains forwarded argument (seeForwardArg
) - Gvar
- Represents access to global variable (i.e.
$foo
) - Gvasgn
- Represents global variable assignment (i.e.
$foo = 42
) - Hash
- Represents a hash literal (i.e.
{ foo: 42 }
) - Hash
Pattern - Represents a hash pattern used in pattern matching (i.e.
in { a: 1 }
) - Heredoc
- Represents a here-document literal (both with and without interpolation)
- IFlip
Flop - Represents inclusive flip-flop (i.e. in
if foo..bar; end
) - If
- Represents an
if
statement (i.e.if foo; bar; else; baz; end
) - IfGuard
- Represents an
if
guard used in pattern matching (i.e.case foo; in pattern if guard; end
) - IfMod
- Represents an
if
/unless
modifier (i.e.stmt if cond
) - IfTernary
- Represents ternary
if
statement (i.e.cond ? if_true : if_false
) - InPattern
- Represents an
in pattern
branch of the pattern matching - Index
- Represents indexing operation (i.e.
foo[1,2,3]
) - Index
Asgn - Represents assignment using indexing operation (i.e.
foo[1, 2, 3] = bar
) - Int
- Represents an integer literal (i.e.
42
) - Irange
- Represents inclusive range (i.e.
2..4
) - Ivar
- Represents access to instance variable (i.e.
@foo
) - Ivasgn
- Represents instance variable assignment (i.e
@foo = 42
) - KwBegin
- Represents an explicit
begin; end
block. - Kwarg
- Represents required keyword argument (i.e.
foo
indef m(foo:); end
) - Kwargs
- Represents kwargs that are given to a method call, super or yield (i.e.
foo(bar: 1)
) - Kwnilarg
- Represents an special argument that rejects all keyword arguments (i.e.
def m(**nil); end
) - Kwoptarg
- Represents an optional keyword argument (i.e.
foo
indef m(foo: 42); end
) - Kwrestarg
- Represents a keyword rest argument (i.e.
foo
indef m(**foo); end
) - Kwsplat
- Represents a keyword arguments splat (i.e.
**bar
in a call likefoo(**bar)
) - Lambda
- Represents a lambda call using
->
(i.e.-> {}
) - Line
- Represents a special
__LINE__
literal - Lvar
- Represents access to a local variable (i.e.
foo
) - Lvasgn
- Represents local variable assignment (i.e.
foo = 42
) - Masgn
- Represents mass-assignment (i.e.
foo, bar = 1, 2
) - Match
Alt - Represents pattern matching using one of the given patterns (i.e.
foo in 1 | 2
) - MatchAs
- Represents matching with renaming into specified local variable (i.e.
case 1; in Integer => a; end
) - Match
Current Line - Represents implicit matching using
if /regex/
- Match
NilPattern - Represents empty hash pattern that is used in pattern matching (i.e.
in **nil
) - Match
Pattern - Represents a one-line pattern matching that can throw an error (i.e.
foo => pattern
) - Match
PatternP - Represents a one-line pattern matching that never throws but returns true/false (i.e.
foo in pattern
) - Match
Rest - Represents a wildcard pattern used in pattern matching (i.e.
in *foo
) - Match
Var - Represents matching with assignment into a local variable (i.e.
pattern => var
) - Match
With Lvasgn - Represents matching a regex that produces local variables (i.e.
/(?<match>bar)/ =~ 'bar'
) - Mlhs
- Represents left hand statement of the mass-assignment (i.e.
foo, bar
infoo, bar = 1, 2
) - Module
- Represents module declaration using
module
keyword - Next
- Represents
next
keyword - Nil
- Represents
nil
literal - NthRef
- Represents numeric global variable (e.g.
$1
) - Numblock
- Represents a block that takes numbered parameters (i.e.
proc { _1 }
) - OpAsgn
- Represents an operation with assignment (e.g.
a += 1
) - Optarg
- Represents optional positional argument (i.e.
foo
inm(foo = 1)
) - Or
- Represents
foo || bar
(orfoo or bar
) statement. - OrAsgn
- Represents
lhs ||= rhs
assignment - Pair
- Represents a key/value pair (e.g. a part of the
Hash
node) - Pin
- Represents a pattern based on a “pinned” variable (e.g.
^foo
) - Postexe
- Represents
END { .. }
statement - Preexe
- Represents
BEGIN { ... }
statement - Procarg0
- Represents a sole block argument (e.g.
|foo|
) - Rational
- Represents rational literal (e.g.
1r
) - Redo
- Represents
redo
keyword - RegOpt
- Represents flags of the regex literal (i.e.
mix
for/foo/mix
) - Regexp
- Represents regex literal (e.g.
/foo/
) - Rescue
- Represents a
rescue
block - Rescue
Body - Represents a single
rescue
handler (i.e.rescue E => e ...
) - Restarg
- Represents positional rest argument (i.e.
*foo
indef m(*foo); end
) - Retry
- Represents
retry
keyword - Return
- Represents
return
keyword - SClass
- Represents opening a singleton class (i.e.
class << foo; ... end;
) - Self_
- Represents
self
keyword - Send
- Represents a method call (e.g.
foo.bar(42)
) - Shadowarg
- Represents a special block argument that “shadows” outer variable (i.e.
|;foo|
) - Splat
- Represents an arguments splat (i.e.
*bar
in a call likefoo(*bar)
) - Str
- Represents a plain non-interpolated string literal (e.g.
"foo"
) - Super
- Represents a
super
keyword - Sym
- Represents a plain symbol literal (i.e.
:foo
) - True
- Represents a
true
literal - Undef
- Represents an
undef
keyword (e.g.undef foo, :bar
) - Unless
Guard - Represents an
unless
guard used in pattern matching (i.e.in pattern unless guard
) - Until
- Represents
until
loop - Until
Post - Represents a post-until loop
- When
- Represents a branch of the
case
statement (i.e.when foo
) - While
- Represents
while
loop - While
Post - Represents a post-while loop
- XHeredoc
- Represents a executable here-document literal (both with and without interpolation)
- Xstr
- Represents an executable string (i.e.
`sh #{script_name}`
) - Yield
- Represents an
yield
keyword - ZSuper
- Represents a
super
call without arguments and parentheses
Enums§
- Node
- Generic combination of all known nodes.