Crate ruby_prism_sys
source ·Expand description
ruby-prism-sys
FFI-bindings for prism
.
Structs
- AliasGlobalVariableNode
- AliasMethodNode
- AlternationPatternNode
- AndNode
- ArgumentsNode
- ArrayNode
- ArrayPatternNode
- AssocNode
- AssocSplatNode
- BackReferenceReadNode
- BeginNode
- BlockArgumentNode
- BlockLocalVariableNode
- BlockNode
- BlockParameterNode
- BlockParametersNode
- BreakNode
- CallAndWriteNode
- CallNode
- CallOperatorWriteNode
- CallOrWriteNode
- CallTargetNode
- CapturePatternNode
- CaseMatchNode
- CaseNode
- ClassNode
- ClassVariableAndWriteNode
- ClassVariableOperatorWriteNode
- ClassVariableOrWriteNode
- ClassVariableReadNode
- ClassVariableTargetNode
- ClassVariableWriteNode
- This is a node in the linked list of comments that we’ve found while parsing.
- ConstantAndWriteNode
- A list of constant IDs. Usually used to represent a set of locals.
- ConstantOperatorWriteNode
- ConstantOrWriteNode
- ConstantPathAndWriteNode
- ConstantPathNode
- ConstantPathOperatorWriteNode
- ConstantPathOrWriteNode
- ConstantPathTargetNode
- ConstantPathWriteNode
- A bucket in the hash map.
- The overall constant pool, which stores constants found while parsing.
- ConstantReadNode
- A constant in the pool which effectively stores a string.
- ConstantTargetNode
- ConstantWriteNode
- This is a node in a linked list of contexts.
- DefNode
- DefinedNode
- This struct represents a diagnostic generated during parsing.
- ElseNode
- EmbeddedStatementsNode
- EmbeddedVariableNode
- This struct defines the functions necessary to implement the encoding interface so we can determine how many bytes the subsequent character takes. Each callback should return the number of bytes, or 0 if the next bytes are invalid for the encoding and type.
- EnsureNode
- FalseNode
- FindPatternNode
- FlipFlopNode
- FloatNode
- ForNode
- ForwardingArgumentsNode
- ForwardingParameterNode
- ForwardingSuperNode
- GlobalVariableAndWriteNode
- GlobalVariableOperatorWriteNode
- GlobalVariableOrWriteNode
- GlobalVariableReadNode
- GlobalVariableTargetNode
- GlobalVariableWriteNode
- HashNode
- HashPatternNode
- IfNode
- ImaginaryNode
- ImplicitNode
- ImplicitRestNode
- InNode
- IndexAndWriteNode
- IndexOperatorWriteNode
- IndexOrWriteNode
- IndexTargetNode
- InstanceVariableAndWriteNode
- InstanceVariableOperatorWriteNode
- InstanceVariableOrWriteNode
- InstanceVariableReadNode
- InstanceVariableTargetNode
- InstanceVariableWriteNode
- IntegerNode
- InterpolatedMatchLastLineNode
- InterpolatedRegularExpressionNode
- InterpolatedStringNode
- InterpolatedSymbolNode
- InterpolatedXStringNode
- KeywordHashNode
- KeywordRestParameterNode
- LambdaNode
- When you are lexing through a file, the lexer needs all of the information that the parser additionally provides (for example, the local table). So if you want to properly lex Ruby, you need to actually lex it in the context of the parser. In order to provide this functionality, we optionally allow a struct to be attached to the parser that calls back out to a user-provided callback when each token is lexed.
- When lexing Ruby source, the lexer has a small amount of state to tell which kind of token it is currently lexing. For example, when we find the start of a string, the first token that we return is a TOKEN_STRING_BEGIN token. After that the lexer is now in the PM_LEX_STRING mode, and will return tokens that are found as part of a string.
- This struct represents an abstract linked list that provides common functionality. It is meant to be used any time a linked list is necessary to store data.
- This represents the overall linked list. It keeps a pointer to the head and tail so that iteration is easy and pushing new nodes is easy.
- LocalVariableAndWriteNode
- LocalVariableOperatorWriteNode
- LocalVariableOrWriteNode
- LocalVariableReadNode
- LocalVariableTargetNode
- LocalVariableWriteNode
- This represents a range of bytes in the source string to which a node or token corresponds.
- MatchLastLineNode
- MatchPredicateNode
- MatchRequiredNode
- MatchWriteNode
- MissingNode
- ModuleNode
- MultiTargetNode
- MultiWriteNode
- A list of offsets of newlines in a string. The offsets are assumed to be sorted/inserted in ascending order.
- NextNode
- NilNode
- NoKeywordsParameterNode
- This is the base structure that represents a node in the syntax tree. It is embedded into every node type.
- A list of nodes in the source, most often used for lists of children.
- NumberedParametersNode
- NumberedReferenceReadNode
- OptionalKeywordParameterNode
- OptionalParameterNode
- A scope of locals surrounding the code that is being parsed.
- The options that can be passed to the parser.
- OrNode
- ParametersNode
- ParenthesesNode
- This struct represents the overall parser. It contains a reference to the source file, as well as pointers that indicate where in the source it’s currently parsing. It also contains the most recent and current token that it’s considering.
- A stack of lex modes.
- PinnedExpressionNode
- PinnedVariableNode
- PostExecutionNode
- PreExecutionNode
- ProgramNode
- RangeNode
- RationalNode
- RedoNode
- RegularExpressionNode
- RequiredKeywordParameterNode
- RequiredParameterNode
- RescueModifierNode
- RescueNode
- RestParameterNode
- RetryNode
- ReturnNode
- This struct represents a node in a linked list of scopes. Some scopes can see into their parent scopes, while others cannot.
- SelfNode
- SingletonClassNode
- SourceEncodingNode
- SourceFileNode
- SourceLineNode
- SplatNode
- StatementsNode
- StringNode
- A generic string type that can have various ownership semantics.
- SuperNode
- SymbolNode
- This struct represents a token in the Ruby source. We use it to track both type and location information.
- TrueNode
- UndefNode
- UnlessNode
- UntilNode
- WhenNode
- WhileNode
- XStringNode
- YieldNode
Enums
- Flags for arguments nodes.
- Flags for array nodes.
- Flags for call nodes.
- This is the type of a comment that we’ve found while parsing.
- Flags for nodes that have unescaped content.
- Flags for integer nodes that correspond to the base of the integer.
- Flags for keyword hash nodes.
- Flags for while and until loop nodes.
- This enum represents every type of node in the Ruby syntax tree.
- The type of encoding for a pack template string.
- The endianness of a pack directive.
- The type of length of a pack directive.
- The result of parsing a pack template.
- The signness of a pack directive.
- The size of an integer pack directive.
- A directive within the pack template.
- The type of pack template we are parsing.
- Flags for range and flip-flop nodes.
- Flags for regular expression and match last line nodes.
- Flags for string nodes.
- Flags for symbol nodes.
Constants
- a begin statement
- expressions in block arguments using braces
- expressions in block arguments using do..end
- a case in statements
- a case when statements
- a class declaration
- a method definition
- a method definition’s default parameter
- a method definition’s parameters
- an else clause
- an elsif clause
- an interpolated expression
- an ensure statement
- an ensure statement within a method definition
- a for loop
- a for loop’s index
- an if statement
- a lambda expression with braces
- a lambda expression with do..end
- the top level context
- a module declaration
- a parenthesized expression
- an END block
- a predicate inside an if/elsif/unless statement
- a BEGIN block
- a rescue statement
- a rescue statement within a method definition
- a rescue else statement
- a rescue else statement within a method definition
- a singleton class definition
- an unless statement
- an until statement
- a while statement
- This state is used when any given token is being lexed.
- This state is used when we’re lexing as normal but inside an embedded expression of a string.
- This state is used when we’re lexing a variable that is embedded directly inside of a string with the # shorthand.
- This state is used when you are inside the content of a heredoc.
- This state is used when we are lexing a list of tokens, as in a %w word list literal or a %i symbol list literal.
- This state is used when a regular expression has been begun and we are looking for the terminator.
- This state is used when we are lexing a string or a string-like token, as in string content with either quote or an xstring.
- This string is a constant string, and should not be freed.
- This string is a memory-mapped file, and should be freed using
pm_string_free
. - This string owns its memory, and should be freed using
pm_string_free
. - This is a slice of another string, and should not be freed.
- &
- &&
- &&=
- &.
- &=
- `
- a back reference
- ! or !@
- !=
- !~
- {
- }
- [
- [ for the beginning of an array
- []
- []=
- ]
- ^
- ^=
- a character literal
- a class variable
- :
- ::
- ,
- a comment
- a constant
- the . call operator
- the .. range operator
- the … range operator or forwarding parameter
- =begin
- =end
- a line inside of embedded documentation
- #{
- }
- final token in the file
- =
- ==
- ===
- =>
- =~
- a floating point number
- a floating pointer number with an imaginary suffix
- a floating pointer number with a rational suffix
- a floating pointer number with a rational and imaginary suffix
- a global variable
=
=
- the end of a heredoc
- the start of a heredoc
- an identifier
- an ignored newline
- an instance variable
- an integer (any base)
- an integer with an imaginary suffix
- an integer with a rational suffix
- an integer with a rational and imaginary suffix
- alias
- and
- begin
- BEGIN
- break
- case
- class
- def
- defined?
- do
- do keyword for a predicate in a while, until, or for loop
- else
- elsif
- end
- END
- ensure
- false
- for
- if
- if in the modifier form
- in
- module
- next
- nil
- not
- or
- redo
- rescue
- rescue in the modifier form
- retry
- return
- self
- super
- then
- true
- undef
- unless
- unless in the modifier form
- until
- until in the modifier form
- when
- while
- while in the modifier form
- yield
- ENCODING
- FILE
- LINE
- a label
- the end of a label
- {
- <
- <=
- <=>
- <<
- <<=
- The maximum token value.
- a method name
- -=
- ->
- a token that was expected but not found
- a newline character outside of other tokens
- a token that was not present but it is okay
- a numbered reference to a capture group in the previous regular expression match
- (
- ( for a parentheses node
- )
- %
- %=
- %i
- %w
- %x
- %I
- %W
- |
- |=
- ||
- ||=
- +=
- ?
- the beginning of a regular expression
- the end of a regular expression
- ;
- /
- /=
- *=
- **
- **=
- the beginning of a string
- the contents of a string
- the end of a string
- the beginning of a symbol
- ~ or ~@
- unary &
- unary ::
- unary .. operator
- unary … operator
- -@
- -@ for a number
- +@
- unary *
- unary **
- a separator between words in a list
- marker for the point in the file at which the parser should stop
Statics
- This lookup table is referenced in both the UTF-8 encoding file and the parser directly in order to speed up the default encoding processing. It is used to indicate whether a character is alphabetical, alphanumeric, or uppercase in unicode mappings.
- This is the table of all of the encodings that prism supports.
Functions
- Returns true if the given list is empty.
- Deallocate the internal state of the given list.
- Deallocate a node and all of its children.
- Parse a single directive from a pack or unpack format string.
- Initiate the parser with the given parser.
- Free any memory associated with the given parser.
- Initialize a parser with the given start and end pointers.
- Prism abstracts sizes away from the native system - this converts an abstract size to a native size.
- Free the associated memory of the given string.
- Returns the length associated with the string.
- Returns the start pointer associated with the string.
- The prism version and the serialization format.
Type Aliases
- AliasGlobalVariableNode
- AliasMethodNode
- AlternationPatternNode
- AndNode
- ArgumentsNode
- ArrayNode
- ArrayPatternNode
- AssocNode
- AssocSplatNode
- BackReferenceReadNode
- BeginNode
- BlockArgumentNode
- BlockLocalVariableNode
- BlockNode
- BlockParameterNode
- BlockParametersNode
- BreakNode
- CallAndWriteNode
- CallNode
- CallOperatorWriteNode
- CallOrWriteNode
- CallTargetNode
- CapturePatternNode
- CaseMatchNode
- CaseNode
- ClassNode
- ClassVariableAndWriteNode
- ClassVariableOperatorWriteNode
- ClassVariableOrWriteNode
- ClassVariableReadNode
- ClassVariableTargetNode
- ClassVariableWriteNode
- This is a node in the linked list of comments that we’ve found while parsing.
- ConstantAndWriteNode
- A constant id is a unique identifier for a constant in the constant pool.
- ConstantOperatorWriteNode
- ConstantOrWriteNode
- ConstantPathAndWriteNode
- ConstantPathNode
- ConstantPathOperatorWriteNode
- ConstantPathOrWriteNode
- ConstantPathTargetNode
- ConstantPathWriteNode
- The type of bucket in the constant pool hash map. This determines how the bucket should be freed.
- ConstantReadNode
- ConstantTargetNode
- ConstantWriteNode
- This is a node in a linked list of contexts.
- While parsing, we keep track of a stack of contexts. This is helpful for error recovery so that we can pop back to a previous context when we hit a token that is understood by a parent context but not by the current context.
- DefNode
- DefinedNode
- ElseNode
- EmbeddedStatementsNode
- EmbeddedVariableNode
- When the encoding that is being used to parse the source is changed by prism, we provide the ability here to call out to a user-defined function.
- EnsureNode
- FalseNode
- FindPatternNode
- FlipFlopNode
- FloatNode
- ForNode
- ForwardingArgumentsNode
- ForwardingParameterNode
- ForwardingSuperNode
- GlobalVariableAndWriteNode
- GlobalVariableOperatorWriteNode
- GlobalVariableOrWriteNode
- GlobalVariableReadNode
- GlobalVariableTargetNode
- GlobalVariableWriteNode
- HashNode
- HashPatternNode
- The type of indentation that a heredoc uses.
- The type of quote that a heredoc uses.
- IfNode
- ImaginaryNode
- ImplicitNode
- ImplicitRestNode
- InNode
- IndexAndWriteNode
- IndexOperatorWriteNode
- IndexOrWriteNode
- IndexTargetNode
- InstanceVariableAndWriteNode
- InstanceVariableOperatorWriteNode
- InstanceVariableOrWriteNode
- InstanceVariableReadNode
- InstanceVariableTargetNode
- InstanceVariableWriteNode
- IntegerNode
- InterpolatedMatchLastLineNode
- InterpolatedRegularExpressionNode
- InterpolatedStringNode
- InterpolatedSymbolNode
- InterpolatedXStringNode
- KeywordHashNode
- KeywordRestParameterNode
- LambdaNode
- The type of this lex mode.
- When lexing Ruby source, the lexer has a small amount of state to tell which kind of token it is currently lexing. For example, when we find the start of a string, the first token that we return is a TOKEN_STRING_BEGIN token. After that the lexer is now in the PM_LEX_STRING mode, and will return tokens that are found as part of a string.
- This enum combines the various bits from the above enum into individual values that represent the various states of the lexer.
- This struct represents an abstract linked list that provides common functionality. It is meant to be used any time a linked list is necessary to store data.
- LocalVariableAndWriteNode
- LocalVariableOperatorWriteNode
- LocalVariableOrWriteNode
- LocalVariableReadNode
- LocalVariableTargetNode
- LocalVariableWriteNode
- MatchLastLineNode
- MatchPredicateNode
- MatchRequiredNode
- MatchWriteNode
- MissingNode
- ModuleNode
- MultiTargetNode
- MultiWriteNode
- NextNode
- NilNode
- NoKeywordsParameterNode
- These are the flags embedded in the node struct. We explicitly control the size of it here to avoid having the variable-width enum.
- This is the base structure that represents a node in the syntax tree. It is embedded into every node type.
- This is the type of node embedded in the node struct. We explicitly control the size of it here to avoid having the variable-width enum.
- NumberedParametersNode
- NumberedReferenceReadNode
- OptionalKeywordParameterNode
- OptionalParameterNode
- A scope of locals surrounding the code that is being parsed.
- OrNode
- ParametersNode
- ParenthesesNode
- The parser used to parse Ruby source.
- PinnedExpressionNode
- PinnedVariableNode
- PostExecutionNode
- PreExecutionNode
- ProgramNode
- RangeNode
- RationalNode
- RedoNode
- RegularExpressionNode
- RequiredKeywordParameterNode
- RequiredParameterNode
- RescueModifierNode
- RescueNode
- RestParameterNode
- RetryNode
- ReturnNode
- This struct represents a node in a linked list of scopes. Some scopes can see into their parent scopes, while others cannot.
- SelfNode
- SingletonClassNode
- SourceEncodingNode
- SourceFileNode
- SourceLineNode
- SplatNode
- A struct that represents a stack of boolean values.
- StatementsNode
- StringNode
- The type of the string. This field determines how the string should be freed.
- SuperNode
- SymbolNode
- This enum represents every type of token in the Ruby source.
- This enum represents every type of token in the Ruby source. This enum represents every type of token in the Ruby source.
- TrueNode
- UndefNode
- UnlessNode
- UntilNode
- WhenNode
- WhileNode
- XStringNode
- YieldNode
Unions
- The data associated with this type of lex mode.