Crate ruby_prism_sys

Crate ruby_prism_sys 

Source
Expand description

§ruby-prism-sys

FFI-bindings for prism.

Structs§

pm_alias_global_variable_node
AliasGlobalVariableNode
pm_alias_method_node
AliasMethodNode
pm_alternation_pattern_node
AlternationPatternNode
pm_and_node
AndNode
pm_arena_t
pm_arguments_node
ArgumentsNode
pm_array_node
ArrayNode
pm_array_pattern_node
ArrayPatternNode
pm_assoc_node
AssocNode
pm_assoc_splat_node
AssocSplatNode
pm_back_reference_read_node
BackReferenceReadNode
pm_begin_node
BeginNode
pm_block_argument_node
BlockArgumentNode
pm_block_local_variable_node
BlockLocalVariableNode
pm_block_node
BlockNode
pm_block_parameter_node
BlockParameterNode
pm_block_parameters_node
BlockParametersNode
pm_break_node
BreakNode
pm_call_and_write_node
CallAndWriteNode
pm_call_node
CallNode
pm_call_operator_write_node
CallOperatorWriteNode
pm_call_or_write_node
CallOrWriteNode
pm_call_target_node
CallTargetNode
pm_capture_pattern_node
CapturePatternNode
pm_case_match_node
CaseMatchNode
pm_case_node
CaseNode
pm_class_node
ClassNode
pm_class_variable_and_write_node
ClassVariableAndWriteNode
pm_class_variable_operator_write_node
ClassVariableOperatorWriteNode
pm_class_variable_or_write_node
ClassVariableOrWriteNode
pm_class_variable_read_node
ClassVariableReadNode
pm_class_variable_target_node
ClassVariableTargetNode
pm_class_variable_write_node
ClassVariableWriteNode
pm_comment_t
pm_constant_and_write_node
ConstantAndWriteNode
pm_constant_id_list_t
A list of constant IDs. Usually used to represent a set of locals.
pm_constant_operator_write_node
ConstantOperatorWriteNode
pm_constant_or_write_node
ConstantOrWriteNode
pm_constant_path_and_write_node
ConstantPathAndWriteNode
pm_constant_path_node
ConstantPathNode
pm_constant_path_operator_write_node
ConstantPathOperatorWriteNode
pm_constant_path_or_write_node
ConstantPathOrWriteNode
pm_constant_path_target_node
ConstantPathTargetNode
pm_constant_path_write_node
ConstantPathWriteNode
pm_constant_read_node
ConstantReadNode
pm_constant_t
pm_constant_target_node
ConstantTargetNode
pm_constant_write_node
ConstantWriteNode
pm_def_node
DefNode
pm_defined_node
DefinedNode
pm_diagnostic_t
pm_else_node
ElseNode
pm_embedded_statements_node
EmbeddedStatementsNode
pm_embedded_variable_node
EmbeddedVariableNode
pm_ensure_node
EnsureNode
pm_error_recovery_node
ErrorRecoveryNode
pm_false_node
FalseNode
pm_find_pattern_node
FindPatternNode
pm_flip_flop_node
FlipFlopNode
pm_float_node
FloatNode
pm_for_node
ForNode
pm_forwarding_arguments_node
ForwardingArgumentsNode
pm_forwarding_parameter_node
ForwardingParameterNode
pm_forwarding_super_node
ForwardingSuperNode
pm_global_variable_and_write_node
GlobalVariableAndWriteNode
pm_global_variable_operator_write_node
GlobalVariableOperatorWriteNode
pm_global_variable_or_write_node
GlobalVariableOrWriteNode
pm_global_variable_read_node
GlobalVariableReadNode
pm_global_variable_target_node
GlobalVariableTargetNode
pm_global_variable_write_node
GlobalVariableWriteNode
pm_hash_node
HashNode
pm_hash_pattern_node
HashPatternNode
pm_if_node
IfNode
pm_imaginary_node
ImaginaryNode
pm_implicit_node
ImplicitNode
pm_implicit_rest_node
ImplicitRestNode
pm_in_node
InNode
pm_index_and_write_node
IndexAndWriteNode
pm_index_operator_write_node
IndexOperatorWriteNode
pm_index_or_write_node
IndexOrWriteNode
pm_index_target_node
IndexTargetNode
pm_instance_variable_and_write_node
InstanceVariableAndWriteNode
pm_instance_variable_operator_write_node
InstanceVariableOperatorWriteNode
pm_instance_variable_or_write_node
InstanceVariableOrWriteNode
pm_instance_variable_read_node
InstanceVariableReadNode
pm_instance_variable_target_node
InstanceVariableTargetNode
pm_instance_variable_write_node
InstanceVariableWriteNode
pm_integer_node
IntegerNode
pm_integer_t
A structure represents an arbitrary-sized integer.
pm_interpolated_match_last_line_node
InterpolatedMatchLastLineNode
pm_interpolated_regular_expression_node
InterpolatedRegularExpressionNode
pm_interpolated_string_node
InterpolatedStringNode
pm_interpolated_symbol_node
InterpolatedSymbolNode
pm_interpolated_x_string_node
InterpolatedXStringNode
pm_it_local_variable_read_node
ItLocalVariableReadNode
pm_it_parameters_node
ItParametersNode
pm_keyword_hash_node
KeywordHashNode
pm_keyword_rest_parameter_node
KeywordRestParameterNode
pm_lambda_node
LambdaNode
pm_line_column_t
A line and column in a string.
pm_line_offset_list_t
A list of offsets of the start of lines in a string. The offsets are assumed to be sorted/inserted in ascending order.
pm_local_variable_and_write_node
LocalVariableAndWriteNode
pm_local_variable_operator_write_node
LocalVariableOperatorWriteNode
pm_local_variable_or_write_node
LocalVariableOrWriteNode
pm_local_variable_read_node
LocalVariableReadNode
pm_local_variable_target_node
LocalVariableTargetNode
pm_local_variable_write_node
LocalVariableWriteNode
pm_location_t
This struct represents a slice in the source code, defined by an offset and a length. Note that we have confirmation that we can represent all locations within Ruby source files using 32-bit integers per:
pm_magic_comment_t
pm_match_last_line_node
MatchLastLineNode
pm_match_predicate_node
MatchPredicateNode
pm_match_required_node
MatchRequiredNode
pm_match_write_node
MatchWriteNode
pm_module_node
ModuleNode
pm_multi_target_node
MultiTargetNode
pm_multi_write_node
MultiWriteNode
pm_next_node
NextNode
pm_nil_node
NilNode
pm_no_block_parameter_node
NoBlockParameterNode
pm_no_keywords_parameter_node
NoKeywordsParameterNode
pm_node
This is the base structure that represents a node in the syntax tree. It is embedded into every node type.
pm_node_list
A list of nodes in the source, most often used for lists of children.
pm_numbered_parameters_node
NumberedParametersNode
pm_numbered_reference_read_node
NumberedReferenceReadNode
pm_optional_keyword_parameter_node
OptionalKeywordParameterNode
pm_optional_parameter_node
OptionalParameterNode
pm_options_scope_t
pm_options_t
pm_or_node
OrNode
pm_parameters_node
ParametersNode
pm_parentheses_node
ParenthesesNode
pm_parser_t
pm_pinned_expression_node
PinnedExpressionNode
pm_pinned_variable_node
PinnedVariableNode
pm_post_execution_node
PostExecutionNode
pm_pre_execution_node
PreExecutionNode
pm_program_node
ProgramNode
pm_range_node
RangeNode
pm_rational_node
RationalNode
pm_redo_node
RedoNode
pm_regular_expression_node
RegularExpressionNode
pm_required_keyword_parameter_node
RequiredKeywordParameterNode
pm_required_parameter_node
RequiredParameterNode
pm_rescue_modifier_node
RescueModifierNode
pm_rescue_node
RescueNode
pm_rest_parameter_node
RestParameterNode
pm_retry_node
RetryNode
pm_return_node
ReturnNode
pm_self_node
SelfNode
pm_shareable_constant_node
ShareableConstantNode
pm_singleton_class_node
SingletonClassNode
pm_source_encoding_node
SourceEncodingNode
pm_source_file_node
SourceFileNode
pm_source_line_node
SourceLineNode
pm_splat_node
SplatNode
pm_statements_node
StatementsNode
pm_string_node
StringNode
pm_string_t
A generic string type that can have various ownership semantics.
pm_super_node
SuperNode
pm_symbol_node
SymbolNode
pm_true_node
TrueNode
pm_undef_node
UndefNode
pm_unless_node
UnlessNode
pm_until_node
UntilNode
pm_when_node
WhenNode
pm_while_node
WhileNode
pm_x_string_node
XStringNode
pm_yield_node
YieldNode

Enums§

pm_arguments_node_flags
Flags for arguments nodes.
pm_array_node_flags
Flags for array nodes.
pm_call_node_flags
Flags for call nodes.
pm_comment_type_t
This is the type of a comment that we’ve found while parsing.
pm_encoding_flags
Flags for nodes that have unescaped content.
pm_error_level_t
The levels of errors generated during parsing.
pm_integer_base_flags
Flags for integer nodes that correspond to the base of the integer.
pm_interpolated_string_node_flags
Flags for interpolated string nodes that indicated mutability if they are also marked as literals.
pm_keyword_hash_node_flags
Flags for keyword hash nodes.
pm_loop_flags
Flags for while and until loop nodes.
pm_node_type
This enum represents every type of node in the Ruby syntax tree.
pm_parameter_flags
Flags for parameter nodes.
pm_parentheses_node_flags
Flags for parentheses nodes.
pm_range_flags
Flags for range and flip-flop nodes.
pm_regular_expression_flags
Flags for regular expression and match last line nodes.
pm_shareable_constant_node_flags
Flags for shareable constant nodes.
pm_string_flags
Flags for string nodes.
pm_symbol_flags
Flags for symbol nodes.
pm_warning_level_t
The levels of warnings generated during parsing.

Constants§

PM_OPTIONS_COMMAND_LINE_A
A bit representing whether or not the command line -a option was set. -a splits the input line $_ into $F.
PM_OPTIONS_COMMAND_LINE_E
A bit representing whether or not the command line -e option was set. -e allow the user to specify a script to be executed. This is necessary for prism to know because certain warnings are not generated when -e is used.
PM_OPTIONS_COMMAND_LINE_L
A bit representing whether or not the command line -l option was set. -l chomps the input line by default.
PM_OPTIONS_COMMAND_LINE_N
A bit representing whether or not the command line -n option was set. -n wraps the script in a while gets loop.
PM_OPTIONS_COMMAND_LINE_P
A bit representing whether or not the command line -p option was set. -p prints the value of $_ at the end of each loop.
PM_OPTIONS_COMMAND_LINE_X
A bit representing whether or not the command line -x option was set. -x searches the input file for a shebang that matches the current Ruby engine.
PM_OPTIONS_SCOPE_FORWARDING_ALL
When the scope is forwarding with the … parameter.
PM_OPTIONS_SCOPE_FORWARDING_BLOCK
When the scope is forwarding with the & parameter.
PM_OPTIONS_SCOPE_FORWARDING_KEYWORDS
When the scope is forwarding with the ** parameter.
PM_OPTIONS_SCOPE_FORWARDING_NONE
The default value for parameters.
PM_OPTIONS_SCOPE_FORWARDING_POSITIONALS
When the scope is forwarding with the * parameter.
PM_STRING_CONSTANT
This string is a constant string, and should not be freed.
PM_STRING_OWNED
This string owns its memory, and should be freed internally.
PM_STRING_SHARED
This is a slice of another string, and should not be freed.

Functions§

pm_arena_free
Frees both the held memory and the arena itself.
pm_arena_new
Returns a newly allocated and initialized arena. If the arena cannot be allocated, this function aborts the process.
pm_comment_location
Returns the location associated with the given comment.
pm_comment_type
Returns the type associated with the given comment.
pm_constant_length
Return the length of a constant.
pm_constant_start
Return a raw pointer to the start of a constant.
pm_diagnostic_error_level
Get the error level associated with the given diagnostic.
pm_diagnostic_location
Get the location of the given diagnostic.
pm_diagnostic_message
Get the message of the given diagnostic.
pm_diagnostic_type
Get the type of the given diagnostic.
pm_diagnostic_warning_level
Get the warning level associated with the given diagnostic.
pm_line_offset_list_line_column
Returns the line and column of the given offset. If the offset is not in the list, the line and column of the closest offset less than the given offset are returned.
pm_magic_comment_key
Returns the location of the key associated with the given magic comment.
pm_magic_comment_value
Returns the location of the value associated with the given magic comment.
pm_options_command_line_set
Sets the command line option on the given options struct.
pm_options_encoding_locked_set
Set the encoding_locked option on the given options struct.
pm_options_encoding_set
Set the encoding option on the given options struct.
pm_options_filepath_set
Set the filepath option on the given options struct.
pm_options_free
Free both the held memory of the given options struct and the struct itself.
pm_options_frozen_string_literal_set
Set the frozen string literal option on the given options struct.
pm_options_line_set
Set the line option on the given options struct.
pm_options_main_script_set
Set the main script option on the given options struct.
pm_options_new
Allocate a new options struct. If the options struct cannot be allocated, this function aborts the process.
pm_options_partial_script_set
Set the partial script option on the given options struct.
pm_options_scope_forwarding_set
Set the forwarding option on the given scope struct.
pm_options_scope_init
Create a new options scope struct. This will hold a set of locals that are in scope surrounding the code that is being parsed. If the scope was unable to allocate its locals, this function will abort the process.
pm_options_scope_local_mut
Return a mutable pointer to the local at the given index within the given scope.
pm_options_scope_mut
Return a mutable pointer to the scope at the given index within the given options.
pm_options_scopes_init
Allocate and zero out the scopes array on the given options struct.
pm_options_version_set
Set the version option on the given options struct by parsing the given string. If the string contains an invalid option, this returns false. Otherwise, it returns true.
pm_parse
Initiate the parser with the given parser.
pm_parser_comments_each
Iterates over the comments associated with the given parser and calls the given callback for each comment.
pm_parser_comments_size
Returns the number of comments associated with the given parser.
pm_parser_constant
Returns a pointer to the constant at the given id in the constant pool associated with the given parser.
pm_parser_constants_each
Iterates over the constants in the constant pool associated with the given parser and calls the given callback for each constant.
pm_parser_constants_size
Returns the number of constants in the constant pool associated with the given parser.
pm_parser_data_loc
Returns the location of the DATA section that is associated with the given parser.
pm_parser_errors_each
Iterates over the errors associated with the given parser and calls the given callback for each error.
pm_parser_errors_size
Returns the number of errors associated with the given parser.
pm_parser_free
Free both the memory held by the given parser and the parser itself.
pm_parser_frozen_string_literal
Returns the frozen string literal value of the parser, as determined by the frozen_string_literal magic comment or the option set on the parser.
pm_parser_line_offsets
Returns the line offsets that are associated with the given parser.
pm_parser_magic_comments_each
Iterates over the magic comments associated with the given parser and calls the given callback for each magic comment.
pm_parser_magic_comments_size
Returns the number of magic comments associated with the given parser.
pm_parser_new
Allocate and initialize a parser with the given start and end pointers.
pm_parser_start
Returns the raw pointer to the start of the source that is being parsed.
pm_parser_start_line
Returns the line that the parser was considered to have started on.
pm_parser_warnings_each
Iterates over the warnings associated with the given parser and calls the given callback for each warning.
pm_parser_warnings_size
Returns the number of warnings associated with the given parser.
pm_string_constant_init
Initialize a constant string that doesn’t own its memory source.
pm_string_length
Returns the length associated with the string.
pm_string_source
Returns the start pointer associated with the string.
pm_version
The prism version and the serialization format.

Type Aliases§

pm_alias_global_variable_node_t
AliasGlobalVariableNode
pm_alias_method_node_t
AliasMethodNode
pm_alternation_pattern_node_t
AlternationPatternNode
pm_and_node_t
AndNode
pm_arguments_node_t
ArgumentsNode
pm_array_node_t
ArrayNode
pm_array_pattern_node_t
ArrayPatternNode
pm_assoc_node_t
AssocNode
pm_assoc_splat_node_t
AssocSplatNode
pm_back_reference_read_node_t
BackReferenceReadNode
pm_begin_node_t
BeginNode
pm_block_argument_node_t
BlockArgumentNode
pm_block_local_variable_node_t
BlockLocalVariableNode
pm_block_node_t
BlockNode
pm_block_parameter_node_t
BlockParameterNode
pm_block_parameters_node_t
BlockParametersNode
pm_break_node_t
BreakNode
pm_call_and_write_node_t
CallAndWriteNode
pm_call_node_t
CallNode
pm_call_operator_write_node_t
CallOperatorWriteNode
pm_call_or_write_node_t
CallOrWriteNode
pm_call_target_node_t
CallTargetNode
pm_capture_pattern_node_t
CapturePatternNode
pm_case_match_node_t
CaseMatchNode
pm_case_node_t
CaseNode
pm_class_node_t
ClassNode
pm_class_variable_and_write_node_t
ClassVariableAndWriteNode
pm_class_variable_operator_write_node_t
ClassVariableOperatorWriteNode
pm_class_variable_or_write_node_t
ClassVariableOrWriteNode
pm_class_variable_read_node_t
ClassVariableReadNode
pm_class_variable_target_node_t
ClassVariableTargetNode
pm_class_variable_write_node_t
ClassVariableWriteNode
pm_comment_callback_t
A callback function that can be used to process comments found while parsing.
pm_constant_and_write_node_t
ConstantAndWriteNode
pm_constant_callback_t
A callback function that can be used to process constants found while parsing.
pm_constant_id_t
A constant id is a unique identifier for a constant in the constant pool.
pm_constant_operator_write_node_t
ConstantOperatorWriteNode
pm_constant_or_write_node_t
ConstantOrWriteNode
pm_constant_path_and_write_node_t
ConstantPathAndWriteNode
pm_constant_path_node_t
ConstantPathNode
pm_constant_path_operator_write_node_t
ConstantPathOperatorWriteNode
pm_constant_path_or_write_node_t
ConstantPathOrWriteNode
pm_constant_path_target_node_t
ConstantPathTargetNode
pm_constant_path_write_node_t
ConstantPathWriteNode
pm_constant_read_node_t
ConstantReadNode
pm_constant_target_node_t
ConstantTargetNode
pm_constant_write_node_t
ConstantWriteNode
pm_def_node_t
DefNode
pm_defined_node_t
DefinedNode
pm_diagnostic_callback_t
A callback function that can be used to process diagnostics found while parsing.
pm_else_node_t
ElseNode
pm_embedded_statements_node_t
EmbeddedStatementsNode
pm_embedded_variable_node_t
EmbeddedVariableNode
pm_ensure_node_t
EnsureNode
pm_error_recovery_node_t
ErrorRecoveryNode
pm_false_node_t
FalseNode
pm_find_pattern_node_t
FindPatternNode
pm_flip_flop_node_t
FlipFlopNode
pm_float_node_t
FloatNode
pm_for_node_t
ForNode
pm_forwarding_arguments_node_t
ForwardingArgumentsNode
pm_forwarding_parameter_node_t
ForwardingParameterNode
pm_forwarding_super_node_t
ForwardingSuperNode
pm_global_variable_and_write_node_t
GlobalVariableAndWriteNode
pm_global_variable_operator_write_node_t
GlobalVariableOperatorWriteNode
pm_global_variable_or_write_node_t
GlobalVariableOrWriteNode
pm_global_variable_read_node_t
GlobalVariableReadNode
pm_global_variable_target_node_t
GlobalVariableTargetNode
pm_global_variable_write_node_t
GlobalVariableWriteNode
pm_hash_node_t
HashNode
pm_hash_pattern_node_t
HashPatternNode
pm_if_node_t
IfNode
pm_imaginary_node_t
ImaginaryNode
pm_implicit_node_t
ImplicitNode
pm_implicit_rest_node_t
ImplicitRestNode
pm_in_node_t
InNode
pm_index_and_write_node_t
IndexAndWriteNode
pm_index_operator_write_node_t
IndexOperatorWriteNode
pm_index_or_write_node_t
IndexOrWriteNode
pm_index_target_node_t
IndexTargetNode
pm_instance_variable_and_write_node_t
InstanceVariableAndWriteNode
pm_instance_variable_operator_write_node_t
InstanceVariableOperatorWriteNode
pm_instance_variable_or_write_node_t
InstanceVariableOrWriteNode
pm_instance_variable_read_node_t
InstanceVariableReadNode
pm_instance_variable_target_node_t
InstanceVariableTargetNode
pm_instance_variable_write_node_t
InstanceVariableWriteNode
pm_integer_node_t
IntegerNode
pm_interpolated_match_last_line_node_t
InterpolatedMatchLastLineNode
pm_interpolated_regular_expression_node_t
InterpolatedRegularExpressionNode
pm_interpolated_string_node_t
InterpolatedStringNode
pm_interpolated_symbol_node_t
InterpolatedSymbolNode
pm_interpolated_x_string_node_t
InterpolatedXStringNode
pm_it_local_variable_read_node_t
ItLocalVariableReadNode
pm_it_parameters_node_t
ItParametersNode
pm_keyword_hash_node_t
KeywordHashNode
pm_keyword_rest_parameter_node_t
KeywordRestParameterNode
pm_lambda_node_t
LambdaNode
pm_local_variable_and_write_node_t
LocalVariableAndWriteNode
pm_local_variable_operator_write_node_t
LocalVariableOperatorWriteNode
pm_local_variable_or_write_node_t
LocalVariableOrWriteNode
pm_local_variable_read_node_t
LocalVariableReadNode
pm_local_variable_target_node_t
LocalVariableTargetNode
pm_local_variable_write_node_t
LocalVariableWriteNode
pm_magic_comment_callback_t
A callback function that can be used to process magic comments found while parsing.
pm_match_last_line_node_t
MatchLastLineNode
pm_match_predicate_node_t
MatchPredicateNode
pm_match_required_node_t
MatchRequiredNode
pm_match_write_node_t
MatchWriteNode
pm_module_node_t
ModuleNode
pm_multi_target_node_t
MultiTargetNode
pm_multi_write_node_t
MultiWriteNode
pm_next_node_t
NextNode
pm_nil_node_t
NilNode
pm_no_block_parameter_node_t
NoBlockParameterNode
pm_no_keywords_parameter_node_t
NoKeywordsParameterNode
pm_node_flags_t
These are the flags embedded in the node struct. We explicitly control the size of it here to avoid having the variable-width enum.
pm_node_t
This is the base structure that represents a node in the syntax tree. It is embedded into every node type.
pm_node_type_t
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.
pm_numbered_parameters_node_t
NumberedParametersNode
pm_numbered_reference_read_node_t
NumberedReferenceReadNode
pm_optional_keyword_parameter_node_t
OptionalKeywordParameterNode
pm_optional_parameter_node_t
OptionalParameterNode
pm_or_node_t
OrNode
pm_parameters_node_t
ParametersNode
pm_parentheses_node_t
ParenthesesNode
pm_pinned_expression_node_t
PinnedExpressionNode
pm_pinned_variable_node_t
PinnedVariableNode
pm_post_execution_node_t
PostExecutionNode
pm_pre_execution_node_t
PreExecutionNode
pm_program_node_t
ProgramNode
pm_range_node_t
RangeNode
pm_rational_node_t
RationalNode
pm_redo_node_t
RedoNode
pm_regular_expression_node_t
RegularExpressionNode
pm_required_keyword_parameter_node_t
RequiredKeywordParameterNode
pm_required_parameter_node_t
RequiredParameterNode
pm_rescue_modifier_node_t
RescueModifierNode
pm_rescue_node_t
RescueNode
pm_rest_parameter_node_t
RestParameterNode
pm_retry_node_t
RetryNode
pm_return_node_t
ReturnNode
pm_self_node_t
SelfNode
pm_shareable_constant_node_t
ShareableConstantNode
pm_singleton_class_node_t
SingletonClassNode
pm_source_encoding_node_t
SourceEncodingNode
pm_source_file_node_t
SourceFileNode
pm_source_line_node_t
SourceLineNode
pm_splat_node_t
SplatNode
pm_statements_node_t
StatementsNode
pm_string_node_t
StringNode
pm_string_t__bindgen_ty_1
The type of the string. This field determines how the string should be freed.
pm_super_node_t
SuperNode
pm_symbol_node_t
SymbolNode
pm_true_node_t
TrueNode
pm_undef_node_t
UndefNode
pm_unless_node_t
UnlessNode
pm_until_node_t
UntilNode
pm_when_node_t
WhenNode
pm_while_node_t
WhileNode
pm_x_string_node_t
XStringNode
pm_yield_node_t
YieldNode