Crate ruby_prism
source ·Expand description
ruby-prism
Rustified version of Ruby’s prism parser.
Structs
- Represents the use of the
alias
keyword to alias a global variable. - Represents the use of the
alias
keyword to alias a method. - Represents an alternation pattern in pattern matching.
- Represents the use of the
&&
operator or theand
keyword. - Represents a set of arguments to a method or a keyword.
- Represents an array literal. This can be a regular array using brackets or a special array using % like %w or %i.
- Represents an array pattern in pattern matching.
- Represents a hash key/value pair.
- Represents a splat in a hash literal.
- Represents reading a reference to a field in the previous match.
- Represents a begin statement.
- Represents a block argument using
&
. - Represents a block local variable.
- Represents a block of ruby code.
- Represents a block parameter of a method, block, or lambda definition.
- Represents a block’s parameters declaration.
- Represents the use of the
break
keyword. - Represents the use of the
&&=
operator on a call. - Represents a method call, in all of the various forms that can take.
- Represents the use of an assignment operator on a call.
- Represents the use of the
||=
operator on a call. - Represents assigning to a method call.
- Represents assigning to a local variable in pattern matching.
- Represents the use of a case statement for pattern matching.
- Represents the use of a case statement.
- Represents a class declaration involving the
class
keyword. - Represents the use of the
&&=
operator for assignment to a class variable. - Represents assigning to a class variable using an operator that isn’t
=
. - Represents the use of the
||=
operator for assignment to a class variable. - Represents referencing a class variable.
- Represents writing to a class variable in a context that doesn’t have an explicit value.
- Represents writing to a class variable.
- A comment that was found during parsing.
- A struct created by the
comments
method onParseResult
. It can be used to iterate over the comments in the parse result. - Represents the use of the
&&=
operator for assignment to a constant. - A handle for a constant ID.
- A list of constants.
- An iterator over the constants in a list.
- Represents assigning to a constant using an operator that isn’t
=
. - Represents the use of the
||=
operator for assignment to a constant. - Represents the use of the
&&=
operator for assignment to a constant path. - Represents accessing a constant through a path of
::
operators. - Represents assigning to a constant path using an operator that isn’t
=
. - Represents the use of the
||=
operator for assignment to a constant path. - Represents writing to a constant path in a context that doesn’t have an explicit value.
- Represents writing to a constant path.
- Represents referencing a constant.
- Represents writing to a constant in a context that doesn’t have an explicit value.
- Represents writing to a constant.
- Represents a method definition.
- Represents the use of the
defined?
keyword. - A diagnostic message that came back from the parser.
- A struct created by the
errors
orwarnings
methods onParseResult
. It can be used to iterate over the diagnostics in the parse result. - Represents an
else
clause in acase
,if
, orunless
statement. - Represents an interpolated set of statements.
- Represents an interpolated variable.
- Represents an
ensure
clause in abegin
statement. - Represents the use of the literal
false
keyword. - Represents a find pattern in pattern matching.
- Represents the use of the
..
or...
operators to create flip flops. - Represents a floating point number literal.
- Represents the use of the
for
keyword. - Represents forwarding all arguments to this method to another method.
- Represents the use of the forwarding parameter in a method, block, or lambda declaration.
- Represents the use of the
super
keyword without parentheses or arguments. - Represents the use of the
&&=
operator for assignment to a global variable. - Represents assigning to a global variable using an operator that isn’t
=
. - Represents the use of the
||=
operator for assignment to a global variable. - Represents referencing a global variable.
- Represents writing to a global variable in a context that doesn’t have an explicit value.
- Represents writing to a global variable.
- Represents a hash literal.
- Represents a hash pattern in pattern matching.
- Represents the use of the
if
keyword, either in the block form or the modifier form, or a ternary expression. - Represents an imaginary number literal.
- Represents a node that is implicitly being added to the tree but doesn’t correspond directly to a node in the source.
- Represents using a trailing comma to indicate an implicit rest parameter.
- Represents the use of the
in
keyword in a case statement. - Represents the use of the
&&=
operator on a call to the[]
method. - Represents the use of an assignment operator on a call to
[]
. - Represents the use of the
||=
operator on a call to[]
. - Represents assigning to an index.
- Represents the use of the
&&=
operator for assignment to an instance variable. - Represents assigning to an instance variable using an operator that isn’t
=
. - Represents the use of the
||=
operator for assignment to an instance variable. - Represents referencing an instance variable.
- Represents writing to an instance variable in a context that doesn’t have an explicit value.
- Represents writing to an instance variable.
- A handle for an arbitarily-sized integer.
- Represents an integer number literal.
- 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.
- Represents a regular expression literal that contains interpolation.
- Represents a string literal that contains interpolation.
- Represents a symbol literal that contains interpolation.
- Represents an xstring literal that contains interpolation.
- Represents reading from the implicit
it
local variable. - Represents an implicit set of parameters through the use of the
it
keyword within a block or lambda. - Represents a hash literal without opening and closing braces.
- Represents a keyword rest parameter to a method, block, or lambda definition.
- Represents using a lambda literal (not the lambda method call).
- Represents the use of the
&&=
operator for assignment to a local variable. - Represents assigning to a local variable using an operator that isn’t
=
. - Represents the use of the
||=
operator for assignment to a local variable. - Represents reading a local variable. Note that this requires that a local variable of the same name has already been written to in the same scope, otherwise it is parsed as a method call.
- Represents writing to a local variable in a context that doesn’t have an explicit value.
- Represents writing to a local variable.
- A range in the source file.
- Represents a regular expression literal used in the predicate of a conditional to implicitly match against the last line read by an IO object.
- Represents the use of the modifier
in
operator. - Represents the use of the
=>
operator. - Represents writing local variables using a regular expression match with named capture groups.
- Represents a node that is missing from the source and results in a syntax error.
- Represents a module declaration involving the
module
keyword. - Represents a multi-target expression.
- Represents a write to a multi-target expression.
- Represents the use of the
next
keyword. - Represents the use of the
nil
keyword. - Represents the use of
**nil
inside method arguments. - A list of nodes.
- An iterator over the nodes in a list.
- Represents an implicit set of parameters through the use of numbered parameters within a block or lambda.
- Represents reading a numbered reference to a capture in the previous match.
- Represents an optional keyword parameter to a method, block, or lambda definition.
- Represents an optional parameter to a method, block, or lambda definition.
- Represents the use of the
||
operator or theor
keyword. - Represents the list of parameters on a method, block, or lambda definition.
- Represents a parenthesized expression
- The result of parsing a source string.
- Represents the use of the
^
operator for pinning an expression in a pattern matching expression. - Represents the use of the
^
operator for pinning a variable in a pattern matching expression. - Represents the use of the
END
keyword. - Represents the use of the
BEGIN
keyword. - The top level node of any parse tree.
- Represents the use of the
..
or...
operators. - Represents a rational number literal.
- Represents the use of the
redo
keyword. - Represents a regular expression literal with no interpolation.
- Represents a required keyword parameter to a method, block, or lambda definition.
- Represents a required parameter to a method, block, or lambda definition.
- Represents an expression modified with a rescue.
- Represents a rescue statement.
- Represents a rest parameter to a method, block, or lambda definition.
- Represents the use of the
retry
keyword. - Represents the use of the
return
keyword. - Represents the
self
keyword. - This node wraps a constant write to indicate that when the value is written, it should have its shareability state modified.
- Represents a singleton class declaration involving the
class
keyword. - Represents the use of the
__ENCODING__
keyword. - Represents the use of the
__FILE__
keyword. - Represents the use of the
__LINE__
keyword. - Represents the use of the splat operator.
- Represents a set of statements contained within some scope.
- Represents a string literal, a string contained within a
%w
list, or plain string content within an interpolated string. - Represents the use of the
super
keyword with parentheses or arguments. - Represents a symbol literal or a symbol contained within a
%i
list. - Represents the use of the literal
true
keyword. - Represents the use of the
undef
keyword. - Represents the use of the
unless
keyword, either in the block form or the modifier form. - Represents the use of the
until
keyword, either in the block form or the modifier form. - Represents the use of the
when
keyword within a case statement. - Represents the use of the
while
keyword, either in the block form or the modifier form. - Represents an xstring literal with no interpolation.
- Represents the use of the
yield
keyword.
Enums
- An enum representing the different kinds of nodes that can be parsed.
Traits
- A trait for visiting the AST.
Functions
- Parses the given source string and returns a parse result.
- The default visitor implementation for a
AliasGlobalVariableNode
node. - The default visitor implementation for a
AliasMethodNode
node. - The default visitor implementation for a
AlternationPatternNode
node. - The default visitor implementation for a
AndNode
node. - The default visitor implementation for a
ArgumentsNode
node. - The default visitor implementation for a
ArrayNode
node. - The default visitor implementation for a
ArrayPatternNode
node. - The default visitor implementation for a
AssocNode
node. - The default visitor implementation for a
AssocSplatNode
node. - The default visitor implementation for a
BackReferenceReadNode
node. - The default visitor implementation for a
BeginNode
node. - The default visitor implementation for a
BlockArgumentNode
node. - The default visitor implementation for a
BlockLocalVariableNode
node. - The default visitor implementation for a
BlockNode
node. - The default visitor implementation for a
BlockParameterNode
node. - The default visitor implementation for a
BlockParametersNode
node. - The default visitor implementation for a
BreakNode
node. - The default visitor implementation for a
CallAndWriteNode
node. - The default visitor implementation for a
CallNode
node. - The default visitor implementation for a
CallOperatorWriteNode
node. - The default visitor implementation for a
CallOrWriteNode
node. - The default visitor implementation for a
CallTargetNode
node. - The default visitor implementation for a
CapturePatternNode
node. - The default visitor implementation for a
CaseMatchNode
node. - The default visitor implementation for a
CaseNode
node. - The default visitor implementation for a
ClassNode
node. - The default visitor implementation for a
ClassVariableAndWriteNode
node. - The default visitor implementation for a
ClassVariableOperatorWriteNode
node. - The default visitor implementation for a
ClassVariableOrWriteNode
node. - The default visitor implementation for a
ClassVariableReadNode
node. - The default visitor implementation for a
ClassVariableTargetNode
node. - The default visitor implementation for a
ClassVariableWriteNode
node. - The default visitor implementation for a
ConstantAndWriteNode
node. - The default visitor implementation for a
ConstantOperatorWriteNode
node. - The default visitor implementation for a
ConstantOrWriteNode
node. - The default visitor implementation for a
ConstantPathAndWriteNode
node. - The default visitor implementation for a
ConstantPathNode
node. - The default visitor implementation for a
ConstantPathOperatorWriteNode
node. - The default visitor implementation for a
ConstantPathOrWriteNode
node. - The default visitor implementation for a
ConstantPathTargetNode
node. - The default visitor implementation for a
ConstantPathWriteNode
node. - The default visitor implementation for a
ConstantReadNode
node. - The default visitor implementation for a
ConstantTargetNode
node. - The default visitor implementation for a
ConstantWriteNode
node. - The default visitor implementation for a
DefNode
node. - The default visitor implementation for a
DefinedNode
node. - The default visitor implementation for a
ElseNode
node. - The default visitor implementation for a
EmbeddedStatementsNode
node. - The default visitor implementation for a
EmbeddedVariableNode
node. - The default visitor implementation for a
EnsureNode
node. - The default visitor implementation for a
FalseNode
node. - The default visitor implementation for a
FindPatternNode
node. - The default visitor implementation for a
FlipFlopNode
node. - The default visitor implementation for a
FloatNode
node. - The default visitor implementation for a
ForNode
node. - The default visitor implementation for a
ForwardingArgumentsNode
node. - The default visitor implementation for a
ForwardingParameterNode
node. - The default visitor implementation for a
ForwardingSuperNode
node. - The default visitor implementation for a
GlobalVariableAndWriteNode
node. - The default visitor implementation for a
GlobalVariableOperatorWriteNode
node. - The default visitor implementation for a
GlobalVariableOrWriteNode
node. - The default visitor implementation for a
GlobalVariableReadNode
node. - The default visitor implementation for a
GlobalVariableTargetNode
node. - The default visitor implementation for a
GlobalVariableWriteNode
node. - The default visitor implementation for a
HashNode
node. - The default visitor implementation for a
HashPatternNode
node. - The default visitor implementation for a
IfNode
node. - The default visitor implementation for a
ImaginaryNode
node. - The default visitor implementation for a
ImplicitNode
node. - The default visitor implementation for a
ImplicitRestNode
node. - The default visitor implementation for a
InNode
node. - The default visitor implementation for a
IndexAndWriteNode
node. - The default visitor implementation for a
IndexOperatorWriteNode
node. - The default visitor implementation for a
IndexOrWriteNode
node. - The default visitor implementation for a
IndexTargetNode
node. - The default visitor implementation for a
InstanceVariableAndWriteNode
node. - The default visitor implementation for a
InstanceVariableOperatorWriteNode
node. - The default visitor implementation for a
InstanceVariableOrWriteNode
node. - The default visitor implementation for a
InstanceVariableReadNode
node. - The default visitor implementation for a
InstanceVariableTargetNode
node. - The default visitor implementation for a
InstanceVariableWriteNode
node. - The default visitor implementation for a
IntegerNode
node. - The default visitor implementation for a
InterpolatedMatchLastLineNode
node. - The default visitor implementation for a
InterpolatedRegularExpressionNode
node. - The default visitor implementation for a
InterpolatedStringNode
node. - The default visitor implementation for a
InterpolatedSymbolNode
node. - The default visitor implementation for a
InterpolatedXStringNode
node. - The default visitor implementation for a
ItLocalVariableReadNode
node. - The default visitor implementation for a
ItParametersNode
node. - The default visitor implementation for a
KeywordHashNode
node. - The default visitor implementation for a
KeywordRestParameterNode
node. - The default visitor implementation for a
LambdaNode
node. - The default visitor implementation for a
LocalVariableAndWriteNode
node. - The default visitor implementation for a
LocalVariableOperatorWriteNode
node. - The default visitor implementation for a
LocalVariableOrWriteNode
node. - The default visitor implementation for a
LocalVariableReadNode
node. - The default visitor implementation for a
LocalVariableTargetNode
node. - The default visitor implementation for a
LocalVariableWriteNode
node. - The default visitor implementation for a
MatchLastLineNode
node. - The default visitor implementation for a
MatchPredicateNode
node. - The default visitor implementation for a
MatchRequiredNode
node. - The default visitor implementation for a
MatchWriteNode
node. - The default visitor implementation for a
MissingNode
node. - The default visitor implementation for a
ModuleNode
node. - The default visitor implementation for a
MultiTargetNode
node. - The default visitor implementation for a
MultiWriteNode
node. - The default visitor implementation for a
NextNode
node. - The default visitor implementation for a
NilNode
node. - The default visitor implementation for a
NoKeywordsParameterNode
node. - The default visitor implementation for a
NumberedParametersNode
node. - The default visitor implementation for a
NumberedReferenceReadNode
node. - The default visitor implementation for a
OptionalKeywordParameterNode
node. - The default visitor implementation for a
OptionalParameterNode
node. - The default visitor implementation for a
OrNode
node. - The default visitor implementation for a
ParametersNode
node. - The default visitor implementation for a
ParenthesesNode
node. - The default visitor implementation for a
PinnedExpressionNode
node. - The default visitor implementation for a
PinnedVariableNode
node. - The default visitor implementation for a
PostExecutionNode
node. - The default visitor implementation for a
PreExecutionNode
node. - The default visitor implementation for a
ProgramNode
node. - The default visitor implementation for a
RangeNode
node. - The default visitor implementation for a
RationalNode
node. - The default visitor implementation for a
RedoNode
node. - The default visitor implementation for a
RegularExpressionNode
node. - The default visitor implementation for a
RequiredKeywordParameterNode
node. - The default visitor implementation for a
RequiredParameterNode
node. - The default visitor implementation for a
RescueModifierNode
node. - The default visitor implementation for a
RescueNode
node. - The default visitor implementation for a
RestParameterNode
node. - The default visitor implementation for a
RetryNode
node. - The default visitor implementation for a
ReturnNode
node. - The default visitor implementation for a
SelfNode
node. - The default visitor implementation for a
ShareableConstantNode
node. - The default visitor implementation for a
SingletonClassNode
node. - The default visitor implementation for a
SourceEncodingNode
node. - The default visitor implementation for a
SourceFileNode
node. - The default visitor implementation for a
SourceLineNode
node. - The default visitor implementation for a
SplatNode
node. - The default visitor implementation for a
StatementsNode
node. - The default visitor implementation for a
StringNode
node. - The default visitor implementation for a
SuperNode
node. - The default visitor implementation for a
SymbolNode
node. - The default visitor implementation for a
TrueNode
node. - The default visitor implementation for a
UndefNode
node. - The default visitor implementation for a
UnlessNode
node. - The default visitor implementation for a
UntilNode
node. - The default visitor implementation for a
WhenNode
node. - The default visitor implementation for a
WhileNode
node. - The default visitor implementation for a
XStringNode
node. - The default visitor implementation for a
YieldNode
node.