Expand description
Module with all known node types
Modules§
Structs§
- Alias
- Represents
alias to fromstatement. - And
- Represents
foo && bar(orfoo and bar) statement. - AndAsgn
- Represents
a &&= 1statement. - 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
&blkargument of the method call (but not of the method definition, seeBlockArg) - Blockarg
- Represents a
&blkargument in the method definition (but not in the method call, seeBlockPass) - Break
- Represents a
breakkeyword (with optional argument) - CSend
- Represents conditional method call using
&.operator - Case
- Represents a
casestatement (for pattern matching seeCaseMatchnode) - Case
Match - Represents a
casestatement used for pattern matching (for regularcaseseeCasenode) - 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
classkeyword,Class.newis just a method call) - Complex
- Represents a
Complexliteral (that returns anComplexnumber) - 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
defkeyword (not on a singleton, seeDefsnode). - 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
falseliteral - 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
forloop - 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
ifstatement (i.e.if foo; bar; else; baz; end) - IfGuard
- Represents an
ifguard used in pattern matching (i.e.case foo; in pattern if guard; end) - IfMod
- Represents an
if/unlessmodifier (i.e.stmt if cond) - IfTernary
- Represents ternary
ifstatement (i.e.cond ? if_true : if_false) - InPattern
- Represents an
in patternbranch 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; endblock. - Kwarg
- Represents required keyword argument (i.e.
fooindef 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.
fooindef m(foo: 42); end) - Kwrestarg
- Represents a keyword rest argument (i.e.
fooindef m(**foo); end) - Kwsplat
- Represents a keyword arguments splat (i.e.
**barin 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, barinfoo, bar = 1, 2) - Module
- Represents module declaration using
modulekeyword - Next
- Represents
nextkeyword - Nil
- Represents
nilliteral - 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.
fooinm(foo = 1)) - Or
- Represents
foo || bar(orfoo or bar) statement. - OrAsgn
- Represents
lhs ||= rhsassignment - Pair
- Represents a key/value pair (e.g. a part of the
Hashnode) - 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
redokeyword - RegOpt
- Represents flags of the regex literal (i.e.
mixfor/foo/mix) - Regexp
- Represents regex literal (e.g.
/foo/) - Rescue
- Represents a
rescueblock - Rescue
Body - Represents a single
rescuehandler (i.e.rescue E => e ...) - Restarg
- Represents positional rest argument (i.e.
*fooindef m(*foo); end) - Retry
- Represents
retrykeyword - Return
- Represents
returnkeyword - SClass
- Represents opening a singleton class (i.e.
class << foo; ... end;) - Self_
- Represents
selfkeyword - 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.
*barin a call likefoo(*bar)) - Str
- Represents a plain non-interpolated string literal (e.g.
"foo") - Super
- Represents a
superkeyword - Sym
- Represents a plain symbol literal (i.e.
:foo) - True
- Represents a
trueliteral - Undef
- Represents an
undefkeyword (e.g.undef foo, :bar) - Unless
Guard - Represents an
unlessguard used in pattern matching (i.e.in pattern unless guard) - Until
- Represents
untilloop - Until
Post - Represents a post-until loop
- When
- Represents a branch of the
casestatement (i.e.when foo) - While
- Represents
whileloop - 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
yieldkeyword - ZSuper
- Represents a
supercall without arguments and parentheses
Enums§
- Node
- Generic combination of all known nodes.