include/yarp/ast.h in yarp-0.9.0 vs include/yarp/ast.h in yarp-0.10.0
- old
+ new
@@ -186,19 +186,19 @@
// This struct represents a token in the Ruby source. We use it to track both
// type and location information.
typedef struct {
yp_token_type_t type;
- const char *start;
- const char *end;
+ const uint8_t *start;
+ const uint8_t *end;
} yp_token_t;
// This represents a range of bytes in the source string to which a node or
// token corresponds.
typedef struct {
- const char *start;
- const char *end;
+ const uint8_t *start;
+ const uint8_t *end;
} yp_location_t;
typedef struct {
yp_location_t *locations;
size_t size;
@@ -366,58 +366,69 @@
typedef struct yp_node {
// This represents the type of the node. It somewhat maps to the nodes that
// existed in the original grammar and ripper, but it's not a 1:1 mapping.
yp_node_type_t type;
- // This represents any flags on the node. Currently, this is only a newline
- // flag
+ // This represents any flags on the node
yp_node_flags_t flags;
// This is the location of the node in the source. It's a range of bytes
// containing a start and an end.
yp_location_t location;
} yp_node_t;
// AliasNode
+//
+// Type: YP_NODE_ALIAS_NODE
typedef struct yp_alias_node {
yp_node_t base;
struct yp_node *new_name;
struct yp_node *old_name;
yp_location_t keyword_loc;
} yp_alias_node_t;
// AlternationPatternNode
+//
+// Type: YP_NODE_ALTERNATION_PATTERN_NODE
typedef struct yp_alternation_pattern_node {
yp_node_t base;
struct yp_node *left;
struct yp_node *right;
yp_location_t operator_loc;
} yp_alternation_pattern_node_t;
// AndNode
+//
+// Type: YP_NODE_AND_NODE
typedef struct yp_and_node {
yp_node_t base;
struct yp_node *left;
struct yp_node *right;
yp_location_t operator_loc;
} yp_and_node_t;
// ArgumentsNode
+//
+// Type: YP_NODE_ARGUMENTS_NODE
typedef struct yp_arguments_node {
yp_node_t base;
struct yp_node_list arguments;
} yp_arguments_node_t;
// ArrayNode
+//
+// Type: YP_NODE_ARRAY_NODE
typedef struct yp_array_node {
yp_node_t base;
struct yp_node_list elements;
yp_location_t opening_loc;
yp_location_t closing_loc;
} yp_array_node_t;
// ArrayPatternNode
+//
+// Type: YP_NODE_ARRAY_PATTERN_NODE
typedef struct yp_array_pattern_node {
yp_node_t base;
struct yp_node *constant;
struct yp_node_list requireds;
struct yp_node *rest;
@@ -425,30 +436,38 @@
yp_location_t opening_loc;
yp_location_t closing_loc;
} yp_array_pattern_node_t;
// AssocNode
+//
+// Type: YP_NODE_ASSOC_NODE
typedef struct yp_assoc_node {
yp_node_t base;
struct yp_node *key;
struct yp_node *value;
yp_location_t operator_loc;
} yp_assoc_node_t;
// AssocSplatNode
+//
+// Type: YP_NODE_ASSOC_SPLAT_NODE
typedef struct yp_assoc_splat_node {
yp_node_t base;
struct yp_node *value;
yp_location_t operator_loc;
} yp_assoc_splat_node_t;
// BackReferenceReadNode
+//
+// Type: YP_NODE_BACK_REFERENCE_READ_NODE
typedef struct yp_back_reference_read_node {
yp_node_t base;
} yp_back_reference_read_node_t;
// BeginNode
+//
+// Type: YP_NODE_BEGIN_NODE
typedef struct yp_begin_node {
yp_node_t base;
yp_location_t begin_keyword_loc;
struct yp_statements_node *statements;
struct yp_rescue_node *rescue_clause;
@@ -456,50 +475,65 @@
struct yp_ensure_node *ensure_clause;
yp_location_t end_keyword_loc;
} yp_begin_node_t;
// BlockArgumentNode
+//
+// Type: YP_NODE_BLOCK_ARGUMENT_NODE
typedef struct yp_block_argument_node {
yp_node_t base;
struct yp_node *expression;
yp_location_t operator_loc;
} yp_block_argument_node_t;
// BlockNode
+//
+// Type: YP_NODE_BLOCK_NODE
typedef struct yp_block_node {
yp_node_t base;
yp_constant_id_list_t locals;
struct yp_block_parameters_node *parameters;
struct yp_node *body;
yp_location_t opening_loc;
yp_location_t closing_loc;
} yp_block_node_t;
// BlockParameterNode
+//
+// Type: YP_NODE_BLOCK_PARAMETER_NODE
typedef struct yp_block_parameter_node {
yp_node_t base;
yp_location_t name_loc;
yp_location_t operator_loc;
} yp_block_parameter_node_t;
// BlockParametersNode
+//
+// Type: YP_NODE_BLOCK_PARAMETERS_NODE
typedef struct yp_block_parameters_node {
yp_node_t base;
struct yp_parameters_node *parameters;
yp_location_list_t locals;
yp_location_t opening_loc;
yp_location_t closing_loc;
} yp_block_parameters_node_t;
// BreakNode
+//
+// Type: YP_NODE_BREAK_NODE
typedef struct yp_break_node {
yp_node_t base;
struct yp_arguments_node *arguments;
yp_location_t keyword_loc;
} yp_break_node_t;
// CallNode
+//
+// Type: YP_NODE_CALL_NODE
+// Flags:
+// YP_CALL_NODE_FLAGS_SAFE_NAVIGATION
+// YP_CALL_NODE_FLAGS_VARIABLE_CALL
typedef struct yp_call_node {
yp_node_t base;
struct yp_node *receiver;
yp_location_t operator_loc;
yp_location_t message_loc;
@@ -509,53 +543,65 @@
struct yp_block_node *block;
yp_string_t name;
} yp_call_node_t;
// CallOperatorAndWriteNode
+//
+// Type: YP_NODE_CALL_OPERATOR_AND_WRITE_NODE
typedef struct yp_call_operator_and_write_node {
yp_node_t base;
struct yp_call_node *target;
yp_location_t operator_loc;
struct yp_node *value;
} yp_call_operator_and_write_node_t;
// CallOperatorOrWriteNode
+//
+// Type: YP_NODE_CALL_OPERATOR_OR_WRITE_NODE
typedef struct yp_call_operator_or_write_node {
yp_node_t base;
struct yp_call_node *target;
struct yp_node *value;
yp_location_t operator_loc;
} yp_call_operator_or_write_node_t;
// CallOperatorWriteNode
+//
+// Type: YP_NODE_CALL_OPERATOR_WRITE_NODE
typedef struct yp_call_operator_write_node {
yp_node_t base;
struct yp_call_node *target;
yp_location_t operator_loc;
struct yp_node *value;
- yp_constant_id_t operator_id;
+ yp_constant_id_t operator;
} yp_call_operator_write_node_t;
// CapturePatternNode
+//
+// Type: YP_NODE_CAPTURE_PATTERN_NODE
typedef struct yp_capture_pattern_node {
yp_node_t base;
struct yp_node *value;
struct yp_node *target;
yp_location_t operator_loc;
} yp_capture_pattern_node_t;
// CaseNode
+//
+// Type: YP_NODE_CASE_NODE
typedef struct yp_case_node {
yp_node_t base;
struct yp_node *predicate;
struct yp_node_list conditions;
struct yp_else_node *consequent;
yp_location_t case_keyword_loc;
yp_location_t end_keyword_loc;
} yp_case_node_t;
// ClassNode
+//
+// Type: YP_NODE_CLASS_NODE
typedef struct yp_class_node {
yp_node_t base;
yp_constant_id_list_t locals;
yp_location_t class_keyword_loc;
struct yp_node *constant_path;
@@ -565,145 +611,189 @@
yp_location_t end_keyword_loc;
yp_string_t name;
} yp_class_node_t;
// ClassVariableAndWriteNode
+//
+// Type: YP_NODE_CLASS_VARIABLE_AND_WRITE_NODE
typedef struct yp_class_variable_and_write_node {
yp_node_t base;
+ yp_constant_id_t name;
yp_location_t name_loc;
yp_location_t operator_loc;
struct yp_node *value;
} yp_class_variable_and_write_node_t;
// ClassVariableOperatorWriteNode
+//
+// Type: YP_NODE_CLASS_VARIABLE_OPERATOR_WRITE_NODE
typedef struct yp_class_variable_operator_write_node {
yp_node_t base;
+ yp_constant_id_t name;
yp_location_t name_loc;
yp_location_t operator_loc;
struct yp_node *value;
yp_constant_id_t operator;
} yp_class_variable_operator_write_node_t;
// ClassVariableOrWriteNode
+//
+// Type: YP_NODE_CLASS_VARIABLE_OR_WRITE_NODE
typedef struct yp_class_variable_or_write_node {
yp_node_t base;
+ yp_constant_id_t name;
yp_location_t name_loc;
yp_location_t operator_loc;
struct yp_node *value;
} yp_class_variable_or_write_node_t;
// ClassVariableReadNode
+//
+// Type: YP_NODE_CLASS_VARIABLE_READ_NODE
typedef struct yp_class_variable_read_node {
yp_node_t base;
+ yp_constant_id_t name;
} yp_class_variable_read_node_t;
// ClassVariableTargetNode
+//
+// Type: YP_NODE_CLASS_VARIABLE_TARGET_NODE
typedef struct yp_class_variable_target_node {
yp_node_t base;
+ yp_constant_id_t name;
} yp_class_variable_target_node_t;
// ClassVariableWriteNode
+//
+// Type: YP_NODE_CLASS_VARIABLE_WRITE_NODE
typedef struct yp_class_variable_write_node {
yp_node_t base;
+ yp_constant_id_t name;
yp_location_t name_loc;
struct yp_node *value;
yp_location_t operator_loc;
} yp_class_variable_write_node_t;
// ConstantAndWriteNode
+//
+// Type: YP_NODE_CONSTANT_AND_WRITE_NODE
typedef struct yp_constant_and_write_node {
yp_node_t base;
yp_location_t name_loc;
yp_location_t operator_loc;
struct yp_node *value;
} yp_constant_and_write_node_t;
// ConstantOperatorWriteNode
+//
+// Type: YP_NODE_CONSTANT_OPERATOR_WRITE_NODE
typedef struct yp_constant_operator_write_node {
yp_node_t base;
yp_location_t name_loc;
yp_location_t operator_loc;
struct yp_node *value;
yp_constant_id_t operator;
} yp_constant_operator_write_node_t;
// ConstantOrWriteNode
+//
+// Type: YP_NODE_CONSTANT_OR_WRITE_NODE
typedef struct yp_constant_or_write_node {
yp_node_t base;
yp_location_t name_loc;
yp_location_t operator_loc;
struct yp_node *value;
} yp_constant_or_write_node_t;
// ConstantPathAndWriteNode
+//
+// Type: YP_NODE_CONSTANT_PATH_AND_WRITE_NODE
typedef struct yp_constant_path_and_write_node {
yp_node_t base;
struct yp_constant_path_node *target;
yp_location_t operator_loc;
struct yp_node *value;
} yp_constant_path_and_write_node_t;
// ConstantPathNode
+//
+// Type: YP_NODE_CONSTANT_PATH_NODE
typedef struct yp_constant_path_node {
yp_node_t base;
struct yp_node *parent;
struct yp_node *child;
yp_location_t delimiter_loc;
} yp_constant_path_node_t;
// ConstantPathOperatorWriteNode
+//
+// Type: YP_NODE_CONSTANT_PATH_OPERATOR_WRITE_NODE
typedef struct yp_constant_path_operator_write_node {
yp_node_t base;
struct yp_constant_path_node *target;
yp_location_t operator_loc;
struct yp_node *value;
yp_constant_id_t operator;
} yp_constant_path_operator_write_node_t;
// ConstantPathOrWriteNode
+//
+// Type: YP_NODE_CONSTANT_PATH_OR_WRITE_NODE
typedef struct yp_constant_path_or_write_node {
yp_node_t base;
struct yp_constant_path_node *target;
yp_location_t operator_loc;
struct yp_node *value;
} yp_constant_path_or_write_node_t;
// ConstantPathTargetNode
+//
+// Type: YP_NODE_CONSTANT_PATH_TARGET_NODE
typedef struct yp_constant_path_target_node {
yp_node_t base;
struct yp_node *parent;
struct yp_node *child;
yp_location_t delimiter_loc;
} yp_constant_path_target_node_t;
// ConstantPathWriteNode
+//
+// Type: YP_NODE_CONSTANT_PATH_WRITE_NODE
typedef struct yp_constant_path_write_node {
yp_node_t base;
struct yp_constant_path_node *target;
yp_location_t operator_loc;
struct yp_node *value;
} yp_constant_path_write_node_t;
// ConstantReadNode
+//
+// Type: YP_NODE_CONSTANT_READ_NODE
typedef struct yp_constant_read_node {
yp_node_t base;
} yp_constant_read_node_t;
// ConstantTargetNode
+//
+// Type: YP_NODE_CONSTANT_TARGET_NODE
typedef struct yp_constant_target_node {
yp_node_t base;
} yp_constant_target_node_t;
// ConstantWriteNode
+//
+// Type: YP_NODE_CONSTANT_WRITE_NODE
typedef struct yp_constant_write_node {
yp_node_t base;
yp_location_t name_loc;
struct yp_node *value;
yp_location_t operator_loc;
} yp_constant_write_node_t;
// DefNode
+//
+// Type: YP_NODE_DEF_NODE
typedef struct yp_def_node {
yp_node_t base;
yp_location_t name_loc;
struct yp_node *receiver;
struct yp_parameters_node *parameters;
@@ -716,55 +806,69 @@
yp_location_t equal_loc;
yp_location_t end_keyword_loc;
} yp_def_node_t;
// DefinedNode
+//
+// Type: YP_NODE_DEFINED_NODE
typedef struct yp_defined_node {
yp_node_t base;
yp_location_t lparen_loc;
struct yp_node *value;
yp_location_t rparen_loc;
yp_location_t keyword_loc;
} yp_defined_node_t;
// ElseNode
+//
+// Type: YP_NODE_ELSE_NODE
typedef struct yp_else_node {
yp_node_t base;
yp_location_t else_keyword_loc;
struct yp_statements_node *statements;
yp_location_t end_keyword_loc;
} yp_else_node_t;
// EmbeddedStatementsNode
+//
+// Type: YP_NODE_EMBEDDED_STATEMENTS_NODE
typedef struct yp_embedded_statements_node {
yp_node_t base;
yp_location_t opening_loc;
struct yp_statements_node *statements;
yp_location_t closing_loc;
} yp_embedded_statements_node_t;
// EmbeddedVariableNode
+//
+// Type: YP_NODE_EMBEDDED_VARIABLE_NODE
typedef struct yp_embedded_variable_node {
yp_node_t base;
yp_location_t operator_loc;
struct yp_node *variable;
} yp_embedded_variable_node_t;
// EnsureNode
+//
+// Type: YP_NODE_ENSURE_NODE
typedef struct yp_ensure_node {
yp_node_t base;
yp_location_t ensure_keyword_loc;
struct yp_statements_node *statements;
yp_location_t end_keyword_loc;
} yp_ensure_node_t;
// FalseNode
+//
+// Type: YP_NODE_FALSE_NODE
typedef struct yp_false_node {
yp_node_t base;
} yp_false_node_t;
// FindPatternNode
+//
+// Type: YP_NODE_FIND_PATTERN_NODE
typedef struct yp_find_pattern_node {
yp_node_t base;
struct yp_node *constant;
struct yp_node *left;
struct yp_node_list requireds;
@@ -772,23 +876,31 @@
yp_location_t opening_loc;
yp_location_t closing_loc;
} yp_find_pattern_node_t;
// FlipFlopNode
+//
+// Type: YP_NODE_FLIP_FLOP_NODE
+// Flags:
+// YP_RANGE_FLAGS_EXCLUDE_END
typedef struct yp_flip_flop_node {
yp_node_t base;
struct yp_node *left;
struct yp_node *right;
yp_location_t operator_loc;
} yp_flip_flop_node_t;
// FloatNode
+//
+// Type: YP_NODE_FLOAT_NODE
typedef struct yp_float_node {
yp_node_t base;
} yp_float_node_t;
// ForNode
+//
+// Type: YP_NODE_FOR_NODE
typedef struct yp_for_node {
yp_node_t base;
struct yp_node *index;
struct yp_node *collection;
struct yp_statements_node *statements;
@@ -797,212 +909,285 @@
yp_location_t do_keyword_loc;
yp_location_t end_keyword_loc;
} yp_for_node_t;
// ForwardingArgumentsNode
+//
+// Type: YP_NODE_FORWARDING_ARGUMENTS_NODE
typedef struct yp_forwarding_arguments_node {
yp_node_t base;
} yp_forwarding_arguments_node_t;
// ForwardingParameterNode
+//
+// Type: YP_NODE_FORWARDING_PARAMETER_NODE
typedef struct yp_forwarding_parameter_node {
yp_node_t base;
} yp_forwarding_parameter_node_t;
// ForwardingSuperNode
+//
+// Type: YP_NODE_FORWARDING_SUPER_NODE
typedef struct yp_forwarding_super_node {
yp_node_t base;
struct yp_block_node *block;
} yp_forwarding_super_node_t;
// GlobalVariableAndWriteNode
+//
+// Type: YP_NODE_GLOBAL_VARIABLE_AND_WRITE_NODE
typedef struct yp_global_variable_and_write_node {
yp_node_t base;
yp_location_t name_loc;
yp_location_t operator_loc;
struct yp_node *value;
} yp_global_variable_and_write_node_t;
// GlobalVariableOperatorWriteNode
+//
+// Type: YP_NODE_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE
typedef struct yp_global_variable_operator_write_node {
yp_node_t base;
yp_location_t name_loc;
yp_location_t operator_loc;
struct yp_node *value;
yp_constant_id_t operator;
} yp_global_variable_operator_write_node_t;
// GlobalVariableOrWriteNode
+//
+// Type: YP_NODE_GLOBAL_VARIABLE_OR_WRITE_NODE
typedef struct yp_global_variable_or_write_node {
yp_node_t base;
yp_location_t name_loc;
yp_location_t operator_loc;
struct yp_node *value;
} yp_global_variable_or_write_node_t;
// GlobalVariableReadNode
+//
+// Type: YP_NODE_GLOBAL_VARIABLE_READ_NODE
typedef struct yp_global_variable_read_node {
yp_node_t base;
} yp_global_variable_read_node_t;
// GlobalVariableTargetNode
+//
+// Type: YP_NODE_GLOBAL_VARIABLE_TARGET_NODE
typedef struct yp_global_variable_target_node {
yp_node_t base;
} yp_global_variable_target_node_t;
// GlobalVariableWriteNode
+//
+// Type: YP_NODE_GLOBAL_VARIABLE_WRITE_NODE
typedef struct yp_global_variable_write_node {
yp_node_t base;
yp_location_t name_loc;
- yp_location_t operator_loc;
struct yp_node *value;
+ yp_location_t operator_loc;
} yp_global_variable_write_node_t;
// HashNode
+//
+// Type: YP_NODE_HASH_NODE
typedef struct yp_hash_node {
yp_node_t base;
yp_location_t opening_loc;
struct yp_node_list elements;
yp_location_t closing_loc;
} yp_hash_node_t;
// HashPatternNode
+//
+// Type: YP_NODE_HASH_PATTERN_NODE
typedef struct yp_hash_pattern_node {
yp_node_t base;
struct yp_node *constant;
struct yp_node_list assocs;
struct yp_node *kwrest;
yp_location_t opening_loc;
yp_location_t closing_loc;
} yp_hash_pattern_node_t;
// IfNode
+//
+// Type: YP_NODE_IF_NODE
typedef struct yp_if_node {
yp_node_t base;
yp_location_t if_keyword_loc;
struct yp_node *predicate;
struct yp_statements_node *statements;
struct yp_node *consequent;
yp_location_t end_keyword_loc;
} yp_if_node_t;
// ImaginaryNode
+//
+// Type: YP_NODE_IMAGINARY_NODE
typedef struct yp_imaginary_node {
yp_node_t base;
struct yp_node *numeric;
} yp_imaginary_node_t;
// InNode
+//
+// Type: YP_NODE_IN_NODE
typedef struct yp_in_node {
yp_node_t base;
struct yp_node *pattern;
struct yp_statements_node *statements;
yp_location_t in_loc;
yp_location_t then_loc;
} yp_in_node_t;
// InstanceVariableAndWriteNode
+//
+// Type: YP_NODE_INSTANCE_VARIABLE_AND_WRITE_NODE
typedef struct yp_instance_variable_and_write_node {
yp_node_t base;
+ yp_constant_id_t name;
yp_location_t name_loc;
yp_location_t operator_loc;
struct yp_node *value;
} yp_instance_variable_and_write_node_t;
// InstanceVariableOperatorWriteNode
+//
+// Type: YP_NODE_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE
typedef struct yp_instance_variable_operator_write_node {
yp_node_t base;
+ yp_constant_id_t name;
yp_location_t name_loc;
yp_location_t operator_loc;
struct yp_node *value;
yp_constant_id_t operator;
} yp_instance_variable_operator_write_node_t;
// InstanceVariableOrWriteNode
+//
+// Type: YP_NODE_INSTANCE_VARIABLE_OR_WRITE_NODE
typedef struct yp_instance_variable_or_write_node {
yp_node_t base;
+ yp_constant_id_t name;
yp_location_t name_loc;
yp_location_t operator_loc;
struct yp_node *value;
} yp_instance_variable_or_write_node_t;
// InstanceVariableReadNode
+//
+// Type: YP_NODE_INSTANCE_VARIABLE_READ_NODE
typedef struct yp_instance_variable_read_node {
yp_node_t base;
+ yp_constant_id_t name;
} yp_instance_variable_read_node_t;
// InstanceVariableTargetNode
+//
+// Type: YP_NODE_INSTANCE_VARIABLE_TARGET_NODE
typedef struct yp_instance_variable_target_node {
yp_node_t base;
+ yp_constant_id_t name;
} yp_instance_variable_target_node_t;
// InstanceVariableWriteNode
+//
+// Type: YP_NODE_INSTANCE_VARIABLE_WRITE_NODE
typedef struct yp_instance_variable_write_node {
yp_node_t base;
+ yp_constant_id_t name;
yp_location_t name_loc;
struct yp_node *value;
yp_location_t operator_loc;
} yp_instance_variable_write_node_t;
// IntegerNode
+//
+// Type: YP_NODE_INTEGER_NODE
typedef struct yp_integer_node {
yp_node_t base;
} yp_integer_node_t;
// InterpolatedRegularExpressionNode
+//
+// Type: YP_NODE_INTERPOLATED_REGULAR_EXPRESSION_NODE
+// Flags:
+// YP_REGULAR_EXPRESSION_FLAGS_IGNORE_CASE
+// YP_REGULAR_EXPRESSION_FLAGS_MULTI_LINE
+// YP_REGULAR_EXPRESSION_FLAGS_EXTENDED
+// YP_REGULAR_EXPRESSION_FLAGS_EUC_JP
+// YP_REGULAR_EXPRESSION_FLAGS_ASCII_8BIT
+// YP_REGULAR_EXPRESSION_FLAGS_WINDOWS_31J
+// YP_REGULAR_EXPRESSION_FLAGS_UTF_8
+// YP_REGULAR_EXPRESSION_FLAGS_ONCE
typedef struct yp_interpolated_regular_expression_node {
yp_node_t base;
yp_location_t opening_loc;
struct yp_node_list parts;
yp_location_t closing_loc;
} yp_interpolated_regular_expression_node_t;
// InterpolatedStringNode
+//
+// Type: YP_NODE_INTERPOLATED_STRING_NODE
typedef struct yp_interpolated_string_node {
yp_node_t base;
yp_location_t opening_loc;
struct yp_node_list parts;
yp_location_t closing_loc;
} yp_interpolated_string_node_t;
// InterpolatedSymbolNode
+//
+// Type: YP_NODE_INTERPOLATED_SYMBOL_NODE
typedef struct yp_interpolated_symbol_node {
yp_node_t base;
yp_location_t opening_loc;
struct yp_node_list parts;
yp_location_t closing_loc;
} yp_interpolated_symbol_node_t;
// InterpolatedXStringNode
+//
+// Type: YP_NODE_INTERPOLATED_X_STRING_NODE
typedef struct yp_interpolated_x_string_node {
yp_node_t base;
yp_location_t opening_loc;
struct yp_node_list parts;
yp_location_t closing_loc;
} yp_interpolated_x_string_node_t;
// KeywordHashNode
+//
+// Type: YP_NODE_KEYWORD_HASH_NODE
typedef struct yp_keyword_hash_node {
yp_node_t base;
struct yp_node_list elements;
} yp_keyword_hash_node_t;
// KeywordParameterNode
+//
+// Type: YP_NODE_KEYWORD_PARAMETER_NODE
typedef struct yp_keyword_parameter_node {
yp_node_t base;
yp_location_t name_loc;
struct yp_node *value;
} yp_keyword_parameter_node_t;
// KeywordRestParameterNode
+//
+// Type: YP_NODE_KEYWORD_REST_PARAMETER_NODE
typedef struct yp_keyword_rest_parameter_node {
yp_node_t base;
yp_location_t operator_loc;
yp_location_t name_loc;
} yp_keyword_rest_parameter_node_t;
// LambdaNode
+//
+// Type: YP_NODE_LAMBDA_NODE
typedef struct yp_lambda_node {
yp_node_t base;
yp_constant_id_list_t locals;
yp_location_t operator_loc;
yp_location_t opening_loc;
@@ -1010,86 +1195,106 @@
struct yp_block_parameters_node *parameters;
struct yp_node *body;
} yp_lambda_node_t;
// LocalVariableAndWriteNode
+//
+// Type: YP_NODE_LOCAL_VARIABLE_AND_WRITE_NODE
typedef struct yp_local_variable_and_write_node {
yp_node_t base;
yp_location_t name_loc;
yp_location_t operator_loc;
struct yp_node *value;
- yp_constant_id_t constant_id;
+ yp_constant_id_t name;
uint32_t depth;
} yp_local_variable_and_write_node_t;
// LocalVariableOperatorWriteNode
+//
+// Type: YP_NODE_LOCAL_VARIABLE_OPERATOR_WRITE_NODE
typedef struct yp_local_variable_operator_write_node {
yp_node_t base;
yp_location_t name_loc;
yp_location_t operator_loc;
struct yp_node *value;
- yp_constant_id_t constant_id;
- yp_constant_id_t operator_id;
+ yp_constant_id_t name;
+ yp_constant_id_t operator;
uint32_t depth;
} yp_local_variable_operator_write_node_t;
// LocalVariableOrWriteNode
+//
+// Type: YP_NODE_LOCAL_VARIABLE_OR_WRITE_NODE
typedef struct yp_local_variable_or_write_node {
yp_node_t base;
yp_location_t name_loc;
yp_location_t operator_loc;
struct yp_node *value;
- yp_constant_id_t constant_id;
+ yp_constant_id_t name;
uint32_t depth;
} yp_local_variable_or_write_node_t;
// LocalVariableReadNode
+//
+// Type: YP_NODE_LOCAL_VARIABLE_READ_NODE
typedef struct yp_local_variable_read_node {
yp_node_t base;
- yp_constant_id_t constant_id;
+ yp_constant_id_t name;
uint32_t depth;
} yp_local_variable_read_node_t;
// LocalVariableTargetNode
+//
+// Type: YP_NODE_LOCAL_VARIABLE_TARGET_NODE
typedef struct yp_local_variable_target_node {
yp_node_t base;
- yp_constant_id_t constant_id;
+ yp_constant_id_t name;
uint32_t depth;
} yp_local_variable_target_node_t;
// LocalVariableWriteNode
+//
+// Type: YP_NODE_LOCAL_VARIABLE_WRITE_NODE
typedef struct yp_local_variable_write_node {
yp_node_t base;
- yp_constant_id_t constant_id;
+ yp_constant_id_t name;
uint32_t depth;
- struct yp_node *value;
yp_location_t name_loc;
+ struct yp_node *value;
yp_location_t operator_loc;
} yp_local_variable_write_node_t;
// MatchPredicateNode
+//
+// Type: YP_NODE_MATCH_PREDICATE_NODE
typedef struct yp_match_predicate_node {
yp_node_t base;
struct yp_node *value;
struct yp_node *pattern;
yp_location_t operator_loc;
} yp_match_predicate_node_t;
// MatchRequiredNode
+//
+// Type: YP_NODE_MATCH_REQUIRED_NODE
typedef struct yp_match_required_node {
yp_node_t base;
struct yp_node *value;
struct yp_node *pattern;
yp_location_t operator_loc;
} yp_match_required_node_t;
// MissingNode
+//
+// Type: YP_NODE_MISSING_NODE
typedef struct yp_missing_node {
yp_node_t base;
} yp_missing_node_t;
// ModuleNode
+//
+// Type: YP_NODE_MODULE_NODE
typedef struct yp_module_node {
yp_node_t base;
yp_constant_id_list_t locals;
yp_location_t module_keyword_loc;
struct yp_node *constant_path;
@@ -1097,61 +1302,78 @@
yp_location_t end_keyword_loc;
yp_string_t name;
} yp_module_node_t;
// MultiWriteNode
+//
+// Type: YP_NODE_MULTI_WRITE_NODE
typedef struct yp_multi_write_node {
yp_node_t base;
struct yp_node_list targets;
yp_location_t operator_loc;
struct yp_node *value;
yp_location_t lparen_loc;
yp_location_t rparen_loc;
} yp_multi_write_node_t;
// NextNode
+//
+// Type: YP_NODE_NEXT_NODE
typedef struct yp_next_node {
yp_node_t base;
struct yp_arguments_node *arguments;
yp_location_t keyword_loc;
} yp_next_node_t;
// NilNode
+//
+// Type: YP_NODE_NIL_NODE
typedef struct yp_nil_node {
yp_node_t base;
} yp_nil_node_t;
// NoKeywordsParameterNode
+//
+// Type: YP_NODE_NO_KEYWORDS_PARAMETER_NODE
typedef struct yp_no_keywords_parameter_node {
yp_node_t base;
yp_location_t operator_loc;
yp_location_t keyword_loc;
} yp_no_keywords_parameter_node_t;
// NumberedReferenceReadNode
+//
+// Type: YP_NODE_NUMBERED_REFERENCE_READ_NODE
typedef struct yp_numbered_reference_read_node {
yp_node_t base;
+ uint32_t number;
} yp_numbered_reference_read_node_t;
// OptionalParameterNode
+//
+// Type: YP_NODE_OPTIONAL_PARAMETER_NODE
typedef struct yp_optional_parameter_node {
yp_node_t base;
- yp_constant_id_t constant_id;
+ yp_constant_id_t name;
yp_location_t name_loc;
yp_location_t operator_loc;
struct yp_node *value;
} yp_optional_parameter_node_t;
// OrNode
+//
+// Type: YP_NODE_OR_NODE
typedef struct yp_or_node {
yp_node_t base;
struct yp_node *left;
struct yp_node *right;
yp_location_t operator_loc;
} yp_or_node_t;
// ParametersNode
+//
+// Type: YP_NODE_PARAMETERS_NODE
typedef struct yp_parameters_node {
yp_node_t base;
struct yp_node_list requireds;
struct yp_node_list optionals;
struct yp_node_list posts;
@@ -1160,109 +1382,148 @@
struct yp_node *keyword_rest;
struct yp_block_parameter_node *block;
} yp_parameters_node_t;
// ParenthesesNode
+//
+// Type: YP_NODE_PARENTHESES_NODE
typedef struct yp_parentheses_node {
yp_node_t base;
struct yp_node *body;
yp_location_t opening_loc;
yp_location_t closing_loc;
} yp_parentheses_node_t;
// PinnedExpressionNode
+//
+// Type: YP_NODE_PINNED_EXPRESSION_NODE
typedef struct yp_pinned_expression_node {
yp_node_t base;
struct yp_node *expression;
yp_location_t operator_loc;
yp_location_t lparen_loc;
yp_location_t rparen_loc;
} yp_pinned_expression_node_t;
// PinnedVariableNode
+//
+// Type: YP_NODE_PINNED_VARIABLE_NODE
typedef struct yp_pinned_variable_node {
yp_node_t base;
struct yp_node *variable;
yp_location_t operator_loc;
} yp_pinned_variable_node_t;
// PostExecutionNode
+//
+// Type: YP_NODE_POST_EXECUTION_NODE
typedef struct yp_post_execution_node {
yp_node_t base;
struct yp_statements_node *statements;
yp_location_t keyword_loc;
yp_location_t opening_loc;
yp_location_t closing_loc;
} yp_post_execution_node_t;
// PreExecutionNode
+//
+// Type: YP_NODE_PRE_EXECUTION_NODE
typedef struct yp_pre_execution_node {
yp_node_t base;
struct yp_statements_node *statements;
yp_location_t keyword_loc;
yp_location_t opening_loc;
yp_location_t closing_loc;
} yp_pre_execution_node_t;
// ProgramNode
+//
+// Type: YP_NODE_PROGRAM_NODE
typedef struct yp_program_node {
yp_node_t base;
yp_constant_id_list_t locals;
struct yp_statements_node *statements;
} yp_program_node_t;
// RangeNode
+//
+// Type: YP_NODE_RANGE_NODE
+// Flags:
+// YP_RANGE_FLAGS_EXCLUDE_END
typedef struct yp_range_node {
yp_node_t base;
struct yp_node *left;
struct yp_node *right;
yp_location_t operator_loc;
} yp_range_node_t;
// RationalNode
+//
+// Type: YP_NODE_RATIONAL_NODE
typedef struct yp_rational_node {
yp_node_t base;
struct yp_node *numeric;
} yp_rational_node_t;
// RedoNode
+//
+// Type: YP_NODE_REDO_NODE
typedef struct yp_redo_node {
yp_node_t base;
} yp_redo_node_t;
// RegularExpressionNode
+//
+// Type: YP_NODE_REGULAR_EXPRESSION_NODE
+// Flags:
+// YP_REGULAR_EXPRESSION_FLAGS_IGNORE_CASE
+// YP_REGULAR_EXPRESSION_FLAGS_MULTI_LINE
+// YP_REGULAR_EXPRESSION_FLAGS_EXTENDED
+// YP_REGULAR_EXPRESSION_FLAGS_EUC_JP
+// YP_REGULAR_EXPRESSION_FLAGS_ASCII_8BIT
+// YP_REGULAR_EXPRESSION_FLAGS_WINDOWS_31J
+// YP_REGULAR_EXPRESSION_FLAGS_UTF_8
+// YP_REGULAR_EXPRESSION_FLAGS_ONCE
typedef struct yp_regular_expression_node {
yp_node_t base;
yp_location_t opening_loc;
yp_location_t content_loc;
yp_location_t closing_loc;
yp_string_t unescaped;
} yp_regular_expression_node_t;
// RequiredDestructuredParameterNode
+//
+// Type: YP_NODE_REQUIRED_DESTRUCTURED_PARAMETER_NODE
typedef struct yp_required_destructured_parameter_node {
yp_node_t base;
struct yp_node_list parameters;
yp_location_t opening_loc;
yp_location_t closing_loc;
} yp_required_destructured_parameter_node_t;
// RequiredParameterNode
+//
+// Type: YP_NODE_REQUIRED_PARAMETER_NODE
typedef struct yp_required_parameter_node {
yp_node_t base;
- yp_constant_id_t constant_id;
+ yp_constant_id_t name;
} yp_required_parameter_node_t;
// RescueModifierNode
+//
+// Type: YP_NODE_RESCUE_MODIFIER_NODE
typedef struct yp_rescue_modifier_node {
yp_node_t base;
struct yp_node *expression;
yp_location_t keyword_loc;
struct yp_node *rescue_expression;
} yp_rescue_modifier_node_t;
// RescueNode
+//
+// Type: YP_NODE_RESCUE_NODE
typedef struct yp_rescue_node {
yp_node_t base;
yp_location_t keyword_loc;
struct yp_node_list exceptions;
yp_location_t operator_loc;
@@ -1270,34 +1531,44 @@
struct yp_statements_node *statements;
struct yp_rescue_node *consequent;
} yp_rescue_node_t;
// RestParameterNode
+//
+// Type: YP_NODE_REST_PARAMETER_NODE
typedef struct yp_rest_parameter_node {
yp_node_t base;
yp_location_t operator_loc;
yp_location_t name_loc;
} yp_rest_parameter_node_t;
// RetryNode
+//
+// Type: YP_NODE_RETRY_NODE
typedef struct yp_retry_node {
yp_node_t base;
} yp_retry_node_t;
// ReturnNode
+//
+// Type: YP_NODE_RETURN_NODE
typedef struct yp_return_node {
yp_node_t base;
yp_location_t keyword_loc;
struct yp_arguments_node *arguments;
} yp_return_node_t;
// SelfNode
+//
+// Type: YP_NODE_SELF_NODE
typedef struct yp_self_node {
yp_node_t base;
} yp_self_node_t;
// SingletonClassNode
+//
+// Type: YP_NODE_SINGLETON_CLASS_NODE
typedef struct yp_singleton_class_node {
yp_node_t base;
yp_constant_id_list_t locals;
yp_location_t class_keyword_loc;
yp_location_t operator_loc;
@@ -1305,130 +1576,168 @@
struct yp_node *body;
yp_location_t end_keyword_loc;
} yp_singleton_class_node_t;
// SourceEncodingNode
+//
+// Type: YP_NODE_SOURCE_ENCODING_NODE
typedef struct yp_source_encoding_node {
yp_node_t base;
} yp_source_encoding_node_t;
// SourceFileNode
+//
+// Type: YP_NODE_SOURCE_FILE_NODE
typedef struct yp_source_file_node {
yp_node_t base;
yp_string_t filepath;
} yp_source_file_node_t;
// SourceLineNode
+//
+// Type: YP_NODE_SOURCE_LINE_NODE
typedef struct yp_source_line_node {
yp_node_t base;
} yp_source_line_node_t;
// SplatNode
+//
+// Type: YP_NODE_SPLAT_NODE
typedef struct yp_splat_node {
yp_node_t base;
yp_location_t operator_loc;
struct yp_node *expression;
} yp_splat_node_t;
// StatementsNode
+//
+// Type: YP_NODE_STATEMENTS_NODE
typedef struct yp_statements_node {
yp_node_t base;
struct yp_node_list body;
} yp_statements_node_t;
// StringConcatNode
+//
+// Type: YP_NODE_STRING_CONCAT_NODE
typedef struct yp_string_concat_node {
yp_node_t base;
struct yp_node *left;
struct yp_node *right;
} yp_string_concat_node_t;
// StringNode
+//
+// Type: YP_NODE_STRING_NODE
typedef struct yp_string_node {
yp_node_t base;
yp_location_t opening_loc;
yp_location_t content_loc;
yp_location_t closing_loc;
yp_string_t unescaped;
} yp_string_node_t;
// SuperNode
+//
+// Type: YP_NODE_SUPER_NODE
typedef struct yp_super_node {
yp_node_t base;
yp_location_t keyword_loc;
yp_location_t lparen_loc;
struct yp_arguments_node *arguments;
yp_location_t rparen_loc;
struct yp_block_node *block;
} yp_super_node_t;
// SymbolNode
+//
+// Type: YP_NODE_SYMBOL_NODE
typedef struct yp_symbol_node {
yp_node_t base;
yp_location_t opening_loc;
yp_location_t value_loc;
yp_location_t closing_loc;
yp_string_t unescaped;
} yp_symbol_node_t;
// TrueNode
+//
+// Type: YP_NODE_TRUE_NODE
typedef struct yp_true_node {
yp_node_t base;
} yp_true_node_t;
// UndefNode
+//
+// Type: YP_NODE_UNDEF_NODE
typedef struct yp_undef_node {
yp_node_t base;
struct yp_node_list names;
yp_location_t keyword_loc;
} yp_undef_node_t;
// UnlessNode
+//
+// Type: YP_NODE_UNLESS_NODE
typedef struct yp_unless_node {
yp_node_t base;
yp_location_t keyword_loc;
struct yp_node *predicate;
struct yp_statements_node *statements;
struct yp_else_node *consequent;
yp_location_t end_keyword_loc;
} yp_unless_node_t;
// UntilNode
+//
+// Type: YP_NODE_UNTIL_NODE
+// Flags:
+// YP_LOOP_FLAGS_BEGIN_MODIFIER
typedef struct yp_until_node {
yp_node_t base;
yp_location_t keyword_loc;
yp_location_t closing_loc;
struct yp_node *predicate;
struct yp_statements_node *statements;
} yp_until_node_t;
// WhenNode
+//
+// Type: YP_NODE_WHEN_NODE
typedef struct yp_when_node {
yp_node_t base;
yp_location_t keyword_loc;
struct yp_node_list conditions;
struct yp_statements_node *statements;
} yp_when_node_t;
// WhileNode
+//
+// Type: YP_NODE_WHILE_NODE
+// Flags:
+// YP_LOOP_FLAGS_BEGIN_MODIFIER
typedef struct yp_while_node {
yp_node_t base;
yp_location_t keyword_loc;
yp_location_t closing_loc;
struct yp_node *predicate;
struct yp_statements_node *statements;
} yp_while_node_t;
// XStringNode
+//
+// Type: YP_NODE_X_STRING_NODE
typedef struct yp_x_string_node {
yp_node_t base;
yp_location_t opening_loc;
yp_location_t content_loc;
yp_location_t closing_loc;
yp_string_t unescaped;
} yp_x_string_node_t;
// YieldNode
+//
+// Type: YP_NODE_YIELD_NODE
typedef struct yp_yield_node {
yp_node_t base;
yp_location_t keyword_loc;
yp_location_t lparen_loc;
struct yp_arguments_node *arguments;