prism 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CHANGELOG.md +172 -0
- data/CODE_OF_CONDUCT.md +76 -0
- data/CONTRIBUTING.md +62 -0
- data/LICENSE.md +7 -0
- data/Makefile +84 -0
- data/README.md +89 -0
- data/config.yml +2481 -0
- data/docs/build_system.md +74 -0
- data/docs/building.md +22 -0
- data/docs/configuration.md +60 -0
- data/docs/design.md +53 -0
- data/docs/encoding.md +117 -0
- data/docs/fuzzing.md +93 -0
- data/docs/heredocs.md +36 -0
- data/docs/mapping.md +117 -0
- data/docs/ripper.md +36 -0
- data/docs/ruby_api.md +25 -0
- data/docs/serialization.md +181 -0
- data/docs/testing.md +55 -0
- data/ext/prism/api_node.c +4725 -0
- data/ext/prism/api_pack.c +256 -0
- data/ext/prism/extconf.rb +136 -0
- data/ext/prism/extension.c +626 -0
- data/ext/prism/extension.h +18 -0
- data/include/prism/ast.h +1932 -0
- data/include/prism/defines.h +45 -0
- data/include/prism/diagnostic.h +231 -0
- data/include/prism/enc/pm_encoding.h +95 -0
- data/include/prism/node.h +41 -0
- data/include/prism/pack.h +141 -0
- data/include/prism/parser.h +418 -0
- data/include/prism/regexp.h +19 -0
- data/include/prism/unescape.h +48 -0
- data/include/prism/util/pm_buffer.h +51 -0
- data/include/prism/util/pm_char.h +91 -0
- data/include/prism/util/pm_constant_pool.h +78 -0
- data/include/prism/util/pm_list.h +67 -0
- data/include/prism/util/pm_memchr.h +14 -0
- data/include/prism/util/pm_newline_list.h +61 -0
- data/include/prism/util/pm_state_stack.h +24 -0
- data/include/prism/util/pm_string.h +61 -0
- data/include/prism/util/pm_string_list.h +25 -0
- data/include/prism/util/pm_strpbrk.h +29 -0
- data/include/prism/version.h +4 -0
- data/include/prism.h +82 -0
- data/lib/prism/compiler.rb +465 -0
- data/lib/prism/debug.rb +157 -0
- data/lib/prism/desugar_compiler.rb +206 -0
- data/lib/prism/dispatcher.rb +2051 -0
- data/lib/prism/dsl.rb +750 -0
- data/lib/prism/ffi.rb +251 -0
- data/lib/prism/lex_compat.rb +838 -0
- data/lib/prism/mutation_compiler.rb +718 -0
- data/lib/prism/node.rb +14540 -0
- data/lib/prism/node_ext.rb +55 -0
- data/lib/prism/node_inspector.rb +68 -0
- data/lib/prism/pack.rb +185 -0
- data/lib/prism/parse_result/comments.rb +172 -0
- data/lib/prism/parse_result/newlines.rb +60 -0
- data/lib/prism/parse_result.rb +266 -0
- data/lib/prism/pattern.rb +239 -0
- data/lib/prism/ripper_compat.rb +174 -0
- data/lib/prism/serialize.rb +662 -0
- data/lib/prism/visitor.rb +470 -0
- data/lib/prism.rb +64 -0
- data/prism.gemspec +113 -0
- data/src/diagnostic.c +287 -0
- data/src/enc/pm_big5.c +52 -0
- data/src/enc/pm_euc_jp.c +58 -0
- data/src/enc/pm_gbk.c +61 -0
- data/src/enc/pm_shift_jis.c +56 -0
- data/src/enc/pm_tables.c +507 -0
- data/src/enc/pm_unicode.c +2324 -0
- data/src/enc/pm_windows_31j.c +56 -0
- data/src/node.c +2633 -0
- data/src/pack.c +493 -0
- data/src/prettyprint.c +2136 -0
- data/src/prism.c +14587 -0
- data/src/regexp.c +580 -0
- data/src/serialize.c +1899 -0
- data/src/token_type.c +349 -0
- data/src/unescape.c +637 -0
- data/src/util/pm_buffer.c +103 -0
- data/src/util/pm_char.c +272 -0
- data/src/util/pm_constant_pool.c +252 -0
- data/src/util/pm_list.c +41 -0
- data/src/util/pm_memchr.c +33 -0
- data/src/util/pm_newline_list.c +134 -0
- data/src/util/pm_state_stack.c +19 -0
- data/src/util/pm_string.c +200 -0
- data/src/util/pm_string_list.c +29 -0
- data/src/util/pm_strncasecmp.c +17 -0
- data/src/util/pm_strpbrk.c +66 -0
- metadata +138 -0
data/include/prism/ast.h
ADDED
@@ -0,0 +1,1932 @@
|
|
1
|
+
/******************************************************************************/
|
2
|
+
/* This file is generated by the templates/template.rb script and should not */
|
3
|
+
/* be modified manually. See */
|
4
|
+
/* templates/include/prism/ast.h.erb */
|
5
|
+
/* if you are looking to modify the */
|
6
|
+
/* template */
|
7
|
+
/******************************************************************************/
|
8
|
+
#ifndef PRISM_AST_H
|
9
|
+
#define PRISM_AST_H
|
10
|
+
|
11
|
+
#include "prism/defines.h"
|
12
|
+
#include "prism/util/pm_constant_pool.h"
|
13
|
+
#include "prism/util/pm_string.h"
|
14
|
+
|
15
|
+
#include <assert.h>
|
16
|
+
#include <stddef.h>
|
17
|
+
#include <stdint.h>
|
18
|
+
|
19
|
+
// This enum represents every type of token in the Ruby source.
|
20
|
+
typedef enum pm_token_type {
|
21
|
+
PM_TOKEN_EOF = 1, // final token in the file
|
22
|
+
PM_TOKEN_MISSING, // a token that was expected but not found
|
23
|
+
PM_TOKEN_NOT_PROVIDED, // a token that was not present but it is okay
|
24
|
+
PM_TOKEN_AMPERSAND, // &
|
25
|
+
PM_TOKEN_AMPERSAND_AMPERSAND, // &&
|
26
|
+
PM_TOKEN_AMPERSAND_AMPERSAND_EQUAL, // &&=
|
27
|
+
PM_TOKEN_AMPERSAND_DOT, // &.
|
28
|
+
PM_TOKEN_AMPERSAND_EQUAL, // &=
|
29
|
+
PM_TOKEN_BACKTICK, // `
|
30
|
+
PM_TOKEN_BACK_REFERENCE, // a back reference
|
31
|
+
PM_TOKEN_BANG, // ! or !@
|
32
|
+
PM_TOKEN_BANG_EQUAL, // !=
|
33
|
+
PM_TOKEN_BANG_TILDE, // !~
|
34
|
+
PM_TOKEN_BRACE_LEFT, // {
|
35
|
+
PM_TOKEN_BRACE_RIGHT, // }
|
36
|
+
PM_TOKEN_BRACKET_LEFT, // [
|
37
|
+
PM_TOKEN_BRACKET_LEFT_ARRAY, // [ for the beginning of an array
|
38
|
+
PM_TOKEN_BRACKET_LEFT_RIGHT, // []
|
39
|
+
PM_TOKEN_BRACKET_LEFT_RIGHT_EQUAL, // []=
|
40
|
+
PM_TOKEN_BRACKET_RIGHT, // ]
|
41
|
+
PM_TOKEN_CARET, // ^
|
42
|
+
PM_TOKEN_CARET_EQUAL, // ^=
|
43
|
+
PM_TOKEN_CHARACTER_LITERAL, // a character literal
|
44
|
+
PM_TOKEN_CLASS_VARIABLE, // a class variable
|
45
|
+
PM_TOKEN_COLON, // :
|
46
|
+
PM_TOKEN_COLON_COLON, // ::
|
47
|
+
PM_TOKEN_COMMA, // ,
|
48
|
+
PM_TOKEN_COMMENT, // a comment
|
49
|
+
PM_TOKEN_CONSTANT, // a constant
|
50
|
+
PM_TOKEN_DOT, // .
|
51
|
+
PM_TOKEN_DOT_DOT, // ..
|
52
|
+
PM_TOKEN_DOT_DOT_DOT, // ...
|
53
|
+
PM_TOKEN_EMBDOC_BEGIN, // =begin
|
54
|
+
PM_TOKEN_EMBDOC_END, // =end
|
55
|
+
PM_TOKEN_EMBDOC_LINE, // a line inside of embedded documentation
|
56
|
+
PM_TOKEN_EMBEXPR_BEGIN, // #{
|
57
|
+
PM_TOKEN_EMBEXPR_END, // }
|
58
|
+
PM_TOKEN_EMBVAR, // #
|
59
|
+
PM_TOKEN_EQUAL, // =
|
60
|
+
PM_TOKEN_EQUAL_EQUAL, // ==
|
61
|
+
PM_TOKEN_EQUAL_EQUAL_EQUAL, // ===
|
62
|
+
PM_TOKEN_EQUAL_GREATER, // =>
|
63
|
+
PM_TOKEN_EQUAL_TILDE, // =~
|
64
|
+
PM_TOKEN_FLOAT, // a floating point number
|
65
|
+
PM_TOKEN_FLOAT_IMAGINARY, // a floating pointer number with an imaginary suffix
|
66
|
+
PM_TOKEN_FLOAT_RATIONAL, // a floating pointer number with a rational suffix
|
67
|
+
PM_TOKEN_FLOAT_RATIONAL_IMAGINARY, // a floating pointer number with a rational and imaginary suffix
|
68
|
+
PM_TOKEN_GLOBAL_VARIABLE, // a global variable
|
69
|
+
PM_TOKEN_GREATER, // >
|
70
|
+
PM_TOKEN_GREATER_EQUAL, // >=
|
71
|
+
PM_TOKEN_GREATER_GREATER, // >>
|
72
|
+
PM_TOKEN_GREATER_GREATER_EQUAL, // >>=
|
73
|
+
PM_TOKEN_HEREDOC_END, // the end of a heredoc
|
74
|
+
PM_TOKEN_HEREDOC_START, // the start of a heredoc
|
75
|
+
PM_TOKEN_IDENTIFIER, // an identifier
|
76
|
+
PM_TOKEN_IGNORED_NEWLINE, // an ignored newline
|
77
|
+
PM_TOKEN_INSTANCE_VARIABLE, // an instance variable
|
78
|
+
PM_TOKEN_INTEGER, // an integer (any base)
|
79
|
+
PM_TOKEN_INTEGER_IMAGINARY, // an integer with an imaginary suffix
|
80
|
+
PM_TOKEN_INTEGER_RATIONAL, // an integer with a rational suffix
|
81
|
+
PM_TOKEN_INTEGER_RATIONAL_IMAGINARY, // an integer with a rational and imaginary suffix
|
82
|
+
PM_TOKEN_KEYWORD_ALIAS, // alias
|
83
|
+
PM_TOKEN_KEYWORD_AND, // and
|
84
|
+
PM_TOKEN_KEYWORD_BEGIN, // begin
|
85
|
+
PM_TOKEN_KEYWORD_BEGIN_UPCASE, // BEGIN
|
86
|
+
PM_TOKEN_KEYWORD_BREAK, // break
|
87
|
+
PM_TOKEN_KEYWORD_CASE, // case
|
88
|
+
PM_TOKEN_KEYWORD_CLASS, // class
|
89
|
+
PM_TOKEN_KEYWORD_DEF, // def
|
90
|
+
PM_TOKEN_KEYWORD_DEFINED, // defined?
|
91
|
+
PM_TOKEN_KEYWORD_DO, // do
|
92
|
+
PM_TOKEN_KEYWORD_DO_LOOP, // do keyword for a predicate in a while, until, or for loop
|
93
|
+
PM_TOKEN_KEYWORD_ELSE, // else
|
94
|
+
PM_TOKEN_KEYWORD_ELSIF, // elsif
|
95
|
+
PM_TOKEN_KEYWORD_END, // end
|
96
|
+
PM_TOKEN_KEYWORD_END_UPCASE, // END
|
97
|
+
PM_TOKEN_KEYWORD_ENSURE, // ensure
|
98
|
+
PM_TOKEN_KEYWORD_FALSE, // false
|
99
|
+
PM_TOKEN_KEYWORD_FOR, // for
|
100
|
+
PM_TOKEN_KEYWORD_IF, // if
|
101
|
+
PM_TOKEN_KEYWORD_IF_MODIFIER, // if in the modifier form
|
102
|
+
PM_TOKEN_KEYWORD_IN, // in
|
103
|
+
PM_TOKEN_KEYWORD_MODULE, // module
|
104
|
+
PM_TOKEN_KEYWORD_NEXT, // next
|
105
|
+
PM_TOKEN_KEYWORD_NIL, // nil
|
106
|
+
PM_TOKEN_KEYWORD_NOT, // not
|
107
|
+
PM_TOKEN_KEYWORD_OR, // or
|
108
|
+
PM_TOKEN_KEYWORD_REDO, // redo
|
109
|
+
PM_TOKEN_KEYWORD_RESCUE, // rescue
|
110
|
+
PM_TOKEN_KEYWORD_RESCUE_MODIFIER, // rescue in the modifier form
|
111
|
+
PM_TOKEN_KEYWORD_RETRY, // retry
|
112
|
+
PM_TOKEN_KEYWORD_RETURN, // return
|
113
|
+
PM_TOKEN_KEYWORD_SELF, // self
|
114
|
+
PM_TOKEN_KEYWORD_SUPER, // super
|
115
|
+
PM_TOKEN_KEYWORD_THEN, // then
|
116
|
+
PM_TOKEN_KEYWORD_TRUE, // true
|
117
|
+
PM_TOKEN_KEYWORD_UNDEF, // undef
|
118
|
+
PM_TOKEN_KEYWORD_UNLESS, // unless
|
119
|
+
PM_TOKEN_KEYWORD_UNLESS_MODIFIER, // unless in the modifier form
|
120
|
+
PM_TOKEN_KEYWORD_UNTIL, // until
|
121
|
+
PM_TOKEN_KEYWORD_UNTIL_MODIFIER, // until in the modifier form
|
122
|
+
PM_TOKEN_KEYWORD_WHEN, // when
|
123
|
+
PM_TOKEN_KEYWORD_WHILE, // while
|
124
|
+
PM_TOKEN_KEYWORD_WHILE_MODIFIER, // while in the modifier form
|
125
|
+
PM_TOKEN_KEYWORD_YIELD, // yield
|
126
|
+
PM_TOKEN_KEYWORD___ENCODING__, // __ENCODING__
|
127
|
+
PM_TOKEN_KEYWORD___FILE__, // __FILE__
|
128
|
+
PM_TOKEN_KEYWORD___LINE__, // __LINE__
|
129
|
+
PM_TOKEN_LABEL, // a label
|
130
|
+
PM_TOKEN_LABEL_END, // the end of a label
|
131
|
+
PM_TOKEN_LAMBDA_BEGIN, // {
|
132
|
+
PM_TOKEN_LESS, // <
|
133
|
+
PM_TOKEN_LESS_EQUAL, // <=
|
134
|
+
PM_TOKEN_LESS_EQUAL_GREATER, // <=>
|
135
|
+
PM_TOKEN_LESS_LESS, // <<
|
136
|
+
PM_TOKEN_LESS_LESS_EQUAL, // <<=
|
137
|
+
PM_TOKEN_METHOD_NAME, // a method name
|
138
|
+
PM_TOKEN_MINUS, // -
|
139
|
+
PM_TOKEN_MINUS_EQUAL, // -=
|
140
|
+
PM_TOKEN_MINUS_GREATER, // ->
|
141
|
+
PM_TOKEN_NEWLINE, // a newline character outside of other tokens
|
142
|
+
PM_TOKEN_NUMBERED_REFERENCE, // a numbered reference to a capture group in the previous regular expression match
|
143
|
+
PM_TOKEN_PARENTHESIS_LEFT, // (
|
144
|
+
PM_TOKEN_PARENTHESIS_LEFT_PARENTHESES, // ( for a parentheses node
|
145
|
+
PM_TOKEN_PARENTHESIS_RIGHT, // )
|
146
|
+
PM_TOKEN_PERCENT, // %
|
147
|
+
PM_TOKEN_PERCENT_EQUAL, // %=
|
148
|
+
PM_TOKEN_PERCENT_LOWER_I, // %i
|
149
|
+
PM_TOKEN_PERCENT_LOWER_W, // %w
|
150
|
+
PM_TOKEN_PERCENT_LOWER_X, // %x
|
151
|
+
PM_TOKEN_PERCENT_UPPER_I, // %I
|
152
|
+
PM_TOKEN_PERCENT_UPPER_W, // %W
|
153
|
+
PM_TOKEN_PIPE, // |
|
154
|
+
PM_TOKEN_PIPE_EQUAL, // |=
|
155
|
+
PM_TOKEN_PIPE_PIPE, // ||
|
156
|
+
PM_TOKEN_PIPE_PIPE_EQUAL, // ||=
|
157
|
+
PM_TOKEN_PLUS, // +
|
158
|
+
PM_TOKEN_PLUS_EQUAL, // +=
|
159
|
+
PM_TOKEN_QUESTION_MARK, // ?
|
160
|
+
PM_TOKEN_REGEXP_BEGIN, // the beginning of a regular expression
|
161
|
+
PM_TOKEN_REGEXP_END, // the end of a regular expression
|
162
|
+
PM_TOKEN_SEMICOLON, // ;
|
163
|
+
PM_TOKEN_SLASH, // /
|
164
|
+
PM_TOKEN_SLASH_EQUAL, // /=
|
165
|
+
PM_TOKEN_STAR, // *
|
166
|
+
PM_TOKEN_STAR_EQUAL, // *=
|
167
|
+
PM_TOKEN_STAR_STAR, // **
|
168
|
+
PM_TOKEN_STAR_STAR_EQUAL, // **=
|
169
|
+
PM_TOKEN_STRING_BEGIN, // the beginning of a string
|
170
|
+
PM_TOKEN_STRING_CONTENT, // the contents of a string
|
171
|
+
PM_TOKEN_STRING_END, // the end of a string
|
172
|
+
PM_TOKEN_SYMBOL_BEGIN, // the beginning of a symbol
|
173
|
+
PM_TOKEN_TILDE, // ~ or ~@
|
174
|
+
PM_TOKEN_UAMPERSAND, // unary &
|
175
|
+
PM_TOKEN_UCOLON_COLON, // unary ::
|
176
|
+
PM_TOKEN_UDOT_DOT, // unary ..
|
177
|
+
PM_TOKEN_UDOT_DOT_DOT, // unary ...
|
178
|
+
PM_TOKEN_UMINUS, // -@
|
179
|
+
PM_TOKEN_UMINUS_NUM, // -@ for a number
|
180
|
+
PM_TOKEN_UPLUS, // +@
|
181
|
+
PM_TOKEN_USTAR, // unary *
|
182
|
+
PM_TOKEN_USTAR_STAR, // unary **
|
183
|
+
PM_TOKEN_WORDS_SEP, // a separator between words in a list
|
184
|
+
PM_TOKEN___END__, // marker for the point in the file at which the parser should stop
|
185
|
+
PM_TOKEN_MAXIMUM, // the maximum token value
|
186
|
+
} pm_token_type_t;
|
187
|
+
|
188
|
+
// This struct represents a token in the Ruby source. We use it to track both
|
189
|
+
// type and location information.
|
190
|
+
typedef struct {
|
191
|
+
pm_token_type_t type;
|
192
|
+
const uint8_t *start;
|
193
|
+
const uint8_t *end;
|
194
|
+
} pm_token_t;
|
195
|
+
|
196
|
+
// This represents a range of bytes in the source string to which a node or
|
197
|
+
// token corresponds.
|
198
|
+
typedef struct {
|
199
|
+
const uint8_t *start;
|
200
|
+
const uint8_t *end;
|
201
|
+
} pm_location_t;
|
202
|
+
|
203
|
+
struct pm_node;
|
204
|
+
|
205
|
+
typedef struct pm_node_list {
|
206
|
+
struct pm_node **nodes;
|
207
|
+
size_t size;
|
208
|
+
size_t capacity;
|
209
|
+
} pm_node_list_t;
|
210
|
+
|
211
|
+
enum pm_node_type {
|
212
|
+
PM_ALIAS_GLOBAL_VARIABLE_NODE = 1,
|
213
|
+
PM_ALIAS_METHOD_NODE = 2,
|
214
|
+
PM_ALTERNATION_PATTERN_NODE = 3,
|
215
|
+
PM_AND_NODE = 4,
|
216
|
+
PM_ARGUMENTS_NODE = 5,
|
217
|
+
PM_ARRAY_NODE = 6,
|
218
|
+
PM_ARRAY_PATTERN_NODE = 7,
|
219
|
+
PM_ASSOC_NODE = 8,
|
220
|
+
PM_ASSOC_SPLAT_NODE = 9,
|
221
|
+
PM_BACK_REFERENCE_READ_NODE = 10,
|
222
|
+
PM_BEGIN_NODE = 11,
|
223
|
+
PM_BLOCK_ARGUMENT_NODE = 12,
|
224
|
+
PM_BLOCK_LOCAL_VARIABLE_NODE = 13,
|
225
|
+
PM_BLOCK_NODE = 14,
|
226
|
+
PM_BLOCK_PARAMETER_NODE = 15,
|
227
|
+
PM_BLOCK_PARAMETERS_NODE = 16,
|
228
|
+
PM_BREAK_NODE = 17,
|
229
|
+
PM_CALL_AND_WRITE_NODE = 18,
|
230
|
+
PM_CALL_NODE = 19,
|
231
|
+
PM_CALL_OPERATOR_WRITE_NODE = 20,
|
232
|
+
PM_CALL_OR_WRITE_NODE = 21,
|
233
|
+
PM_CAPTURE_PATTERN_NODE = 22,
|
234
|
+
PM_CASE_NODE = 23,
|
235
|
+
PM_CLASS_NODE = 24,
|
236
|
+
PM_CLASS_VARIABLE_AND_WRITE_NODE = 25,
|
237
|
+
PM_CLASS_VARIABLE_OPERATOR_WRITE_NODE = 26,
|
238
|
+
PM_CLASS_VARIABLE_OR_WRITE_NODE = 27,
|
239
|
+
PM_CLASS_VARIABLE_READ_NODE = 28,
|
240
|
+
PM_CLASS_VARIABLE_TARGET_NODE = 29,
|
241
|
+
PM_CLASS_VARIABLE_WRITE_NODE = 30,
|
242
|
+
PM_CONSTANT_AND_WRITE_NODE = 31,
|
243
|
+
PM_CONSTANT_OPERATOR_WRITE_NODE = 32,
|
244
|
+
PM_CONSTANT_OR_WRITE_NODE = 33,
|
245
|
+
PM_CONSTANT_PATH_AND_WRITE_NODE = 34,
|
246
|
+
PM_CONSTANT_PATH_NODE = 35,
|
247
|
+
PM_CONSTANT_PATH_OPERATOR_WRITE_NODE = 36,
|
248
|
+
PM_CONSTANT_PATH_OR_WRITE_NODE = 37,
|
249
|
+
PM_CONSTANT_PATH_TARGET_NODE = 38,
|
250
|
+
PM_CONSTANT_PATH_WRITE_NODE = 39,
|
251
|
+
PM_CONSTANT_READ_NODE = 40,
|
252
|
+
PM_CONSTANT_TARGET_NODE = 41,
|
253
|
+
PM_CONSTANT_WRITE_NODE = 42,
|
254
|
+
PM_DEF_NODE = 43,
|
255
|
+
PM_DEFINED_NODE = 44,
|
256
|
+
PM_ELSE_NODE = 45,
|
257
|
+
PM_EMBEDDED_STATEMENTS_NODE = 46,
|
258
|
+
PM_EMBEDDED_VARIABLE_NODE = 47,
|
259
|
+
PM_ENSURE_NODE = 48,
|
260
|
+
PM_FALSE_NODE = 49,
|
261
|
+
PM_FIND_PATTERN_NODE = 50,
|
262
|
+
PM_FLIP_FLOP_NODE = 51,
|
263
|
+
PM_FLOAT_NODE = 52,
|
264
|
+
PM_FOR_NODE = 53,
|
265
|
+
PM_FORWARDING_ARGUMENTS_NODE = 54,
|
266
|
+
PM_FORWARDING_PARAMETER_NODE = 55,
|
267
|
+
PM_FORWARDING_SUPER_NODE = 56,
|
268
|
+
PM_GLOBAL_VARIABLE_AND_WRITE_NODE = 57,
|
269
|
+
PM_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE = 58,
|
270
|
+
PM_GLOBAL_VARIABLE_OR_WRITE_NODE = 59,
|
271
|
+
PM_GLOBAL_VARIABLE_READ_NODE = 60,
|
272
|
+
PM_GLOBAL_VARIABLE_TARGET_NODE = 61,
|
273
|
+
PM_GLOBAL_VARIABLE_WRITE_NODE = 62,
|
274
|
+
PM_HASH_NODE = 63,
|
275
|
+
PM_HASH_PATTERN_NODE = 64,
|
276
|
+
PM_IF_NODE = 65,
|
277
|
+
PM_IMAGINARY_NODE = 66,
|
278
|
+
PM_IMPLICIT_NODE = 67,
|
279
|
+
PM_IN_NODE = 68,
|
280
|
+
PM_INSTANCE_VARIABLE_AND_WRITE_NODE = 69,
|
281
|
+
PM_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE = 70,
|
282
|
+
PM_INSTANCE_VARIABLE_OR_WRITE_NODE = 71,
|
283
|
+
PM_INSTANCE_VARIABLE_READ_NODE = 72,
|
284
|
+
PM_INSTANCE_VARIABLE_TARGET_NODE = 73,
|
285
|
+
PM_INSTANCE_VARIABLE_WRITE_NODE = 74,
|
286
|
+
PM_INTEGER_NODE = 75,
|
287
|
+
PM_INTERPOLATED_MATCH_LAST_LINE_NODE = 76,
|
288
|
+
PM_INTERPOLATED_REGULAR_EXPRESSION_NODE = 77,
|
289
|
+
PM_INTERPOLATED_STRING_NODE = 78,
|
290
|
+
PM_INTERPOLATED_SYMBOL_NODE = 79,
|
291
|
+
PM_INTERPOLATED_X_STRING_NODE = 80,
|
292
|
+
PM_KEYWORD_HASH_NODE = 81,
|
293
|
+
PM_KEYWORD_PARAMETER_NODE = 82,
|
294
|
+
PM_KEYWORD_REST_PARAMETER_NODE = 83,
|
295
|
+
PM_LAMBDA_NODE = 84,
|
296
|
+
PM_LOCAL_VARIABLE_AND_WRITE_NODE = 85,
|
297
|
+
PM_LOCAL_VARIABLE_OPERATOR_WRITE_NODE = 86,
|
298
|
+
PM_LOCAL_VARIABLE_OR_WRITE_NODE = 87,
|
299
|
+
PM_LOCAL_VARIABLE_READ_NODE = 88,
|
300
|
+
PM_LOCAL_VARIABLE_TARGET_NODE = 89,
|
301
|
+
PM_LOCAL_VARIABLE_WRITE_NODE = 90,
|
302
|
+
PM_MATCH_LAST_LINE_NODE = 91,
|
303
|
+
PM_MATCH_PREDICATE_NODE = 92,
|
304
|
+
PM_MATCH_REQUIRED_NODE = 93,
|
305
|
+
PM_MATCH_WRITE_NODE = 94,
|
306
|
+
PM_MISSING_NODE = 95,
|
307
|
+
PM_MODULE_NODE = 96,
|
308
|
+
PM_MULTI_TARGET_NODE = 97,
|
309
|
+
PM_MULTI_WRITE_NODE = 98,
|
310
|
+
PM_NEXT_NODE = 99,
|
311
|
+
PM_NIL_NODE = 100,
|
312
|
+
PM_NO_KEYWORDS_PARAMETER_NODE = 101,
|
313
|
+
PM_NUMBERED_REFERENCE_READ_NODE = 102,
|
314
|
+
PM_OPTIONAL_PARAMETER_NODE = 103,
|
315
|
+
PM_OR_NODE = 104,
|
316
|
+
PM_PARAMETERS_NODE = 105,
|
317
|
+
PM_PARENTHESES_NODE = 106,
|
318
|
+
PM_PINNED_EXPRESSION_NODE = 107,
|
319
|
+
PM_PINNED_VARIABLE_NODE = 108,
|
320
|
+
PM_POST_EXECUTION_NODE = 109,
|
321
|
+
PM_PRE_EXECUTION_NODE = 110,
|
322
|
+
PM_PROGRAM_NODE = 111,
|
323
|
+
PM_RANGE_NODE = 112,
|
324
|
+
PM_RATIONAL_NODE = 113,
|
325
|
+
PM_REDO_NODE = 114,
|
326
|
+
PM_REGULAR_EXPRESSION_NODE = 115,
|
327
|
+
PM_REQUIRED_DESTRUCTURED_PARAMETER_NODE = 116,
|
328
|
+
PM_REQUIRED_PARAMETER_NODE = 117,
|
329
|
+
PM_RESCUE_MODIFIER_NODE = 118,
|
330
|
+
PM_RESCUE_NODE = 119,
|
331
|
+
PM_REST_PARAMETER_NODE = 120,
|
332
|
+
PM_RETRY_NODE = 121,
|
333
|
+
PM_RETURN_NODE = 122,
|
334
|
+
PM_SELF_NODE = 123,
|
335
|
+
PM_SINGLETON_CLASS_NODE = 124,
|
336
|
+
PM_SOURCE_ENCODING_NODE = 125,
|
337
|
+
PM_SOURCE_FILE_NODE = 126,
|
338
|
+
PM_SOURCE_LINE_NODE = 127,
|
339
|
+
PM_SPLAT_NODE = 128,
|
340
|
+
PM_STATEMENTS_NODE = 129,
|
341
|
+
PM_STRING_CONCAT_NODE = 130,
|
342
|
+
PM_STRING_NODE = 131,
|
343
|
+
PM_SUPER_NODE = 132,
|
344
|
+
PM_SYMBOL_NODE = 133,
|
345
|
+
PM_TRUE_NODE = 134,
|
346
|
+
PM_UNDEF_NODE = 135,
|
347
|
+
PM_UNLESS_NODE = 136,
|
348
|
+
PM_UNTIL_NODE = 137,
|
349
|
+
PM_WHEN_NODE = 138,
|
350
|
+
PM_WHILE_NODE = 139,
|
351
|
+
PM_X_STRING_NODE = 140,
|
352
|
+
PM_YIELD_NODE = 141,
|
353
|
+
PM_SCOPE_NODE
|
354
|
+
};
|
355
|
+
|
356
|
+
typedef uint16_t pm_node_type_t;
|
357
|
+
typedef uint16_t pm_node_flags_t;
|
358
|
+
|
359
|
+
// We store the flags enum in every node in the tree. Some flags are common to
|
360
|
+
// all nodes (the ones listed below). Others are specific to certain node types.
|
361
|
+
static const pm_node_flags_t PM_NODE_FLAG_NEWLINE = 0x1;
|
362
|
+
static const pm_node_flags_t PM_NODE_FLAG_STATIC_LITERAL = 0x2;
|
363
|
+
|
364
|
+
// For easy access, we define some macros to check node type
|
365
|
+
#define PM_NODE_TYPE(node) ((enum pm_node_type)node->type)
|
366
|
+
#define PM_NODE_TYPE_P(node, type) (PM_NODE_TYPE(node) == (type))
|
367
|
+
|
368
|
+
// This is the overall tagged union representing a node in the syntax tree.
|
369
|
+
typedef struct pm_node {
|
370
|
+
// This represents the type of the node. It somewhat maps to the nodes that
|
371
|
+
// existed in the original grammar and ripper, but it's not a 1:1 mapping.
|
372
|
+
pm_node_type_t type;
|
373
|
+
|
374
|
+
// This represents any flags on the node
|
375
|
+
pm_node_flags_t flags;
|
376
|
+
|
377
|
+
// This is the location of the node in the source. It's a range of bytes
|
378
|
+
// containing a start and an end.
|
379
|
+
pm_location_t location;
|
380
|
+
} pm_node_t;
|
381
|
+
|
382
|
+
// AliasGlobalVariableNode
|
383
|
+
//
|
384
|
+
// Type: PM_ALIAS_GLOBAL_VARIABLE_NODE
|
385
|
+
typedef struct pm_alias_global_variable_node {
|
386
|
+
pm_node_t base;
|
387
|
+
struct pm_node *new_name;
|
388
|
+
struct pm_node *old_name;
|
389
|
+
pm_location_t keyword_loc;
|
390
|
+
} pm_alias_global_variable_node_t;
|
391
|
+
|
392
|
+
// AliasMethodNode
|
393
|
+
//
|
394
|
+
// Type: PM_ALIAS_METHOD_NODE
|
395
|
+
typedef struct pm_alias_method_node {
|
396
|
+
pm_node_t base;
|
397
|
+
struct pm_node *new_name;
|
398
|
+
struct pm_node *old_name;
|
399
|
+
pm_location_t keyword_loc;
|
400
|
+
} pm_alias_method_node_t;
|
401
|
+
|
402
|
+
// AlternationPatternNode
|
403
|
+
//
|
404
|
+
// Type: PM_ALTERNATION_PATTERN_NODE
|
405
|
+
typedef struct pm_alternation_pattern_node {
|
406
|
+
pm_node_t base;
|
407
|
+
struct pm_node *left;
|
408
|
+
struct pm_node *right;
|
409
|
+
pm_location_t operator_loc;
|
410
|
+
} pm_alternation_pattern_node_t;
|
411
|
+
|
412
|
+
// AndNode
|
413
|
+
//
|
414
|
+
// Type: PM_AND_NODE
|
415
|
+
typedef struct pm_and_node {
|
416
|
+
pm_node_t base;
|
417
|
+
struct pm_node *left;
|
418
|
+
struct pm_node *right;
|
419
|
+
pm_location_t operator_loc;
|
420
|
+
} pm_and_node_t;
|
421
|
+
|
422
|
+
// ArgumentsNode
|
423
|
+
//
|
424
|
+
// Type: PM_ARGUMENTS_NODE
|
425
|
+
typedef struct pm_arguments_node {
|
426
|
+
pm_node_t base;
|
427
|
+
struct pm_node_list arguments;
|
428
|
+
} pm_arguments_node_t;
|
429
|
+
|
430
|
+
// ArrayNode
|
431
|
+
//
|
432
|
+
// Type: PM_ARRAY_NODE
|
433
|
+
typedef struct pm_array_node {
|
434
|
+
pm_node_t base;
|
435
|
+
struct pm_node_list elements;
|
436
|
+
pm_location_t opening_loc;
|
437
|
+
pm_location_t closing_loc;
|
438
|
+
} pm_array_node_t;
|
439
|
+
|
440
|
+
// ArrayPatternNode
|
441
|
+
//
|
442
|
+
// Type: PM_ARRAY_PATTERN_NODE
|
443
|
+
typedef struct pm_array_pattern_node {
|
444
|
+
pm_node_t base;
|
445
|
+
struct pm_node *constant;
|
446
|
+
struct pm_node_list requireds;
|
447
|
+
struct pm_node *rest;
|
448
|
+
struct pm_node_list posts;
|
449
|
+
pm_location_t opening_loc;
|
450
|
+
pm_location_t closing_loc;
|
451
|
+
} pm_array_pattern_node_t;
|
452
|
+
|
453
|
+
// AssocNode
|
454
|
+
//
|
455
|
+
// Type: PM_ASSOC_NODE
|
456
|
+
typedef struct pm_assoc_node {
|
457
|
+
pm_node_t base;
|
458
|
+
struct pm_node *key;
|
459
|
+
struct pm_node *value;
|
460
|
+
pm_location_t operator_loc;
|
461
|
+
} pm_assoc_node_t;
|
462
|
+
|
463
|
+
// AssocSplatNode
|
464
|
+
//
|
465
|
+
// Type: PM_ASSOC_SPLAT_NODE
|
466
|
+
typedef struct pm_assoc_splat_node {
|
467
|
+
pm_node_t base;
|
468
|
+
struct pm_node *value;
|
469
|
+
pm_location_t operator_loc;
|
470
|
+
} pm_assoc_splat_node_t;
|
471
|
+
|
472
|
+
// BackReferenceReadNode
|
473
|
+
//
|
474
|
+
// Type: PM_BACK_REFERENCE_READ_NODE
|
475
|
+
typedef struct pm_back_reference_read_node {
|
476
|
+
pm_node_t base;
|
477
|
+
} pm_back_reference_read_node_t;
|
478
|
+
|
479
|
+
// BeginNode
|
480
|
+
//
|
481
|
+
// Type: PM_BEGIN_NODE
|
482
|
+
typedef struct pm_begin_node {
|
483
|
+
pm_node_t base;
|
484
|
+
pm_location_t begin_keyword_loc;
|
485
|
+
struct pm_statements_node *statements;
|
486
|
+
struct pm_rescue_node *rescue_clause;
|
487
|
+
struct pm_else_node *else_clause;
|
488
|
+
struct pm_ensure_node *ensure_clause;
|
489
|
+
pm_location_t end_keyword_loc;
|
490
|
+
} pm_begin_node_t;
|
491
|
+
|
492
|
+
// BlockArgumentNode
|
493
|
+
//
|
494
|
+
// Type: PM_BLOCK_ARGUMENT_NODE
|
495
|
+
typedef struct pm_block_argument_node {
|
496
|
+
pm_node_t base;
|
497
|
+
struct pm_node *expression;
|
498
|
+
pm_location_t operator_loc;
|
499
|
+
} pm_block_argument_node_t;
|
500
|
+
|
501
|
+
// BlockLocalVariableNode
|
502
|
+
//
|
503
|
+
// Type: PM_BLOCK_LOCAL_VARIABLE_NODE
|
504
|
+
typedef struct pm_block_local_variable_node {
|
505
|
+
pm_node_t base;
|
506
|
+
pm_constant_id_t name;
|
507
|
+
} pm_block_local_variable_node_t;
|
508
|
+
|
509
|
+
// BlockNode
|
510
|
+
//
|
511
|
+
// Type: PM_BLOCK_NODE
|
512
|
+
typedef struct pm_block_node {
|
513
|
+
pm_node_t base;
|
514
|
+
pm_constant_id_list_t locals;
|
515
|
+
struct pm_block_parameters_node *parameters;
|
516
|
+
struct pm_node *body;
|
517
|
+
pm_location_t opening_loc;
|
518
|
+
pm_location_t closing_loc;
|
519
|
+
} pm_block_node_t;
|
520
|
+
|
521
|
+
// BlockParameterNode
|
522
|
+
//
|
523
|
+
// Type: PM_BLOCK_PARAMETER_NODE
|
524
|
+
typedef struct pm_block_parameter_node {
|
525
|
+
pm_node_t base;
|
526
|
+
pm_constant_id_t name;
|
527
|
+
pm_location_t name_loc;
|
528
|
+
pm_location_t operator_loc;
|
529
|
+
} pm_block_parameter_node_t;
|
530
|
+
|
531
|
+
// BlockParametersNode
|
532
|
+
//
|
533
|
+
// Type: PM_BLOCK_PARAMETERS_NODE
|
534
|
+
typedef struct pm_block_parameters_node {
|
535
|
+
pm_node_t base;
|
536
|
+
struct pm_parameters_node *parameters;
|
537
|
+
struct pm_node_list locals;
|
538
|
+
pm_location_t opening_loc;
|
539
|
+
pm_location_t closing_loc;
|
540
|
+
} pm_block_parameters_node_t;
|
541
|
+
|
542
|
+
// BreakNode
|
543
|
+
//
|
544
|
+
// Type: PM_BREAK_NODE
|
545
|
+
typedef struct pm_break_node {
|
546
|
+
pm_node_t base;
|
547
|
+
struct pm_arguments_node *arguments;
|
548
|
+
pm_location_t keyword_loc;
|
549
|
+
} pm_break_node_t;
|
550
|
+
|
551
|
+
// CallAndWriteNode
|
552
|
+
//
|
553
|
+
// Type: PM_CALL_AND_WRITE_NODE
|
554
|
+
// Flags:
|
555
|
+
// PM_CALL_NODE_FLAGS_SAFE_NAVIGATION
|
556
|
+
// PM_CALL_NODE_FLAGS_VARIABLE_CALL
|
557
|
+
typedef struct pm_call_and_write_node {
|
558
|
+
pm_node_t base;
|
559
|
+
struct pm_node *receiver;
|
560
|
+
pm_location_t call_operator_loc;
|
561
|
+
pm_location_t message_loc;
|
562
|
+
pm_location_t opening_loc;
|
563
|
+
struct pm_arguments_node *arguments;
|
564
|
+
pm_location_t closing_loc;
|
565
|
+
pm_string_t read_name;
|
566
|
+
pm_string_t write_name;
|
567
|
+
pm_location_t operator_loc;
|
568
|
+
struct pm_node *value;
|
569
|
+
} pm_call_and_write_node_t;
|
570
|
+
|
571
|
+
// CallNode
|
572
|
+
//
|
573
|
+
// Type: PM_CALL_NODE
|
574
|
+
// Flags:
|
575
|
+
// PM_CALL_NODE_FLAGS_SAFE_NAVIGATION
|
576
|
+
// PM_CALL_NODE_FLAGS_VARIABLE_CALL
|
577
|
+
typedef struct pm_call_node {
|
578
|
+
pm_node_t base;
|
579
|
+
struct pm_node *receiver;
|
580
|
+
pm_location_t call_operator_loc;
|
581
|
+
pm_location_t message_loc;
|
582
|
+
pm_location_t opening_loc;
|
583
|
+
struct pm_arguments_node *arguments;
|
584
|
+
pm_location_t closing_loc;
|
585
|
+
struct pm_node *block;
|
586
|
+
pm_string_t name;
|
587
|
+
} pm_call_node_t;
|
588
|
+
|
589
|
+
// CallOperatorWriteNode
|
590
|
+
//
|
591
|
+
// Type: PM_CALL_OPERATOR_WRITE_NODE
|
592
|
+
// Flags:
|
593
|
+
// PM_CALL_NODE_FLAGS_SAFE_NAVIGATION
|
594
|
+
// PM_CALL_NODE_FLAGS_VARIABLE_CALL
|
595
|
+
typedef struct pm_call_operator_write_node {
|
596
|
+
pm_node_t base;
|
597
|
+
struct pm_node *receiver;
|
598
|
+
pm_location_t call_operator_loc;
|
599
|
+
pm_location_t message_loc;
|
600
|
+
pm_location_t opening_loc;
|
601
|
+
struct pm_arguments_node *arguments;
|
602
|
+
pm_location_t closing_loc;
|
603
|
+
pm_string_t read_name;
|
604
|
+
pm_string_t write_name;
|
605
|
+
pm_constant_id_t operator;
|
606
|
+
pm_location_t operator_loc;
|
607
|
+
struct pm_node *value;
|
608
|
+
} pm_call_operator_write_node_t;
|
609
|
+
|
610
|
+
// CallOrWriteNode
|
611
|
+
//
|
612
|
+
// Type: PM_CALL_OR_WRITE_NODE
|
613
|
+
// Flags:
|
614
|
+
// PM_CALL_NODE_FLAGS_SAFE_NAVIGATION
|
615
|
+
// PM_CALL_NODE_FLAGS_VARIABLE_CALL
|
616
|
+
typedef struct pm_call_or_write_node {
|
617
|
+
pm_node_t base;
|
618
|
+
struct pm_node *receiver;
|
619
|
+
pm_location_t call_operator_loc;
|
620
|
+
pm_location_t message_loc;
|
621
|
+
pm_location_t opening_loc;
|
622
|
+
struct pm_arguments_node *arguments;
|
623
|
+
pm_location_t closing_loc;
|
624
|
+
pm_string_t read_name;
|
625
|
+
pm_string_t write_name;
|
626
|
+
pm_location_t operator_loc;
|
627
|
+
struct pm_node *value;
|
628
|
+
} pm_call_or_write_node_t;
|
629
|
+
|
630
|
+
// CapturePatternNode
|
631
|
+
//
|
632
|
+
// Type: PM_CAPTURE_PATTERN_NODE
|
633
|
+
typedef struct pm_capture_pattern_node {
|
634
|
+
pm_node_t base;
|
635
|
+
struct pm_node *value;
|
636
|
+
struct pm_node *target;
|
637
|
+
pm_location_t operator_loc;
|
638
|
+
} pm_capture_pattern_node_t;
|
639
|
+
|
640
|
+
// CaseNode
|
641
|
+
//
|
642
|
+
// Type: PM_CASE_NODE
|
643
|
+
typedef struct pm_case_node {
|
644
|
+
pm_node_t base;
|
645
|
+
struct pm_node *predicate;
|
646
|
+
struct pm_node_list conditions;
|
647
|
+
struct pm_else_node *consequent;
|
648
|
+
pm_location_t case_keyword_loc;
|
649
|
+
pm_location_t end_keyword_loc;
|
650
|
+
} pm_case_node_t;
|
651
|
+
|
652
|
+
// ClassNode
|
653
|
+
//
|
654
|
+
// Type: PM_CLASS_NODE
|
655
|
+
typedef struct pm_class_node {
|
656
|
+
pm_node_t base;
|
657
|
+
pm_constant_id_list_t locals;
|
658
|
+
pm_location_t class_keyword_loc;
|
659
|
+
struct pm_node *constant_path;
|
660
|
+
pm_location_t inheritance_operator_loc;
|
661
|
+
struct pm_node *superclass;
|
662
|
+
struct pm_node *body;
|
663
|
+
pm_location_t end_keyword_loc;
|
664
|
+
pm_constant_id_t name;
|
665
|
+
} pm_class_node_t;
|
666
|
+
|
667
|
+
// ClassVariableAndWriteNode
|
668
|
+
//
|
669
|
+
// Type: PM_CLASS_VARIABLE_AND_WRITE_NODE
|
670
|
+
typedef struct pm_class_variable_and_write_node {
|
671
|
+
pm_node_t base;
|
672
|
+
pm_constant_id_t name;
|
673
|
+
pm_location_t name_loc;
|
674
|
+
pm_location_t operator_loc;
|
675
|
+
struct pm_node *value;
|
676
|
+
} pm_class_variable_and_write_node_t;
|
677
|
+
|
678
|
+
// ClassVariableOperatorWriteNode
|
679
|
+
//
|
680
|
+
// Type: PM_CLASS_VARIABLE_OPERATOR_WRITE_NODE
|
681
|
+
typedef struct pm_class_variable_operator_write_node {
|
682
|
+
pm_node_t base;
|
683
|
+
pm_constant_id_t name;
|
684
|
+
pm_location_t name_loc;
|
685
|
+
pm_location_t operator_loc;
|
686
|
+
struct pm_node *value;
|
687
|
+
pm_constant_id_t operator;
|
688
|
+
} pm_class_variable_operator_write_node_t;
|
689
|
+
|
690
|
+
// ClassVariableOrWriteNode
|
691
|
+
//
|
692
|
+
// Type: PM_CLASS_VARIABLE_OR_WRITE_NODE
|
693
|
+
typedef struct pm_class_variable_or_write_node {
|
694
|
+
pm_node_t base;
|
695
|
+
pm_constant_id_t name;
|
696
|
+
pm_location_t name_loc;
|
697
|
+
pm_location_t operator_loc;
|
698
|
+
struct pm_node *value;
|
699
|
+
} pm_class_variable_or_write_node_t;
|
700
|
+
|
701
|
+
// ClassVariableReadNode
|
702
|
+
//
|
703
|
+
// Type: PM_CLASS_VARIABLE_READ_NODE
|
704
|
+
typedef struct pm_class_variable_read_node {
|
705
|
+
pm_node_t base;
|
706
|
+
pm_constant_id_t name;
|
707
|
+
} pm_class_variable_read_node_t;
|
708
|
+
|
709
|
+
// ClassVariableTargetNode
|
710
|
+
//
|
711
|
+
// Type: PM_CLASS_VARIABLE_TARGET_NODE
|
712
|
+
typedef struct pm_class_variable_target_node {
|
713
|
+
pm_node_t base;
|
714
|
+
pm_constant_id_t name;
|
715
|
+
} pm_class_variable_target_node_t;
|
716
|
+
|
717
|
+
// ClassVariableWriteNode
|
718
|
+
//
|
719
|
+
// Type: PM_CLASS_VARIABLE_WRITE_NODE
|
720
|
+
typedef struct pm_class_variable_write_node {
|
721
|
+
pm_node_t base;
|
722
|
+
pm_constant_id_t name;
|
723
|
+
pm_location_t name_loc;
|
724
|
+
struct pm_node *value;
|
725
|
+
pm_location_t operator_loc;
|
726
|
+
} pm_class_variable_write_node_t;
|
727
|
+
|
728
|
+
// ConstantAndWriteNode
|
729
|
+
//
|
730
|
+
// Type: PM_CONSTANT_AND_WRITE_NODE
|
731
|
+
typedef struct pm_constant_and_write_node {
|
732
|
+
pm_node_t base;
|
733
|
+
pm_constant_id_t name;
|
734
|
+
pm_location_t name_loc;
|
735
|
+
pm_location_t operator_loc;
|
736
|
+
struct pm_node *value;
|
737
|
+
} pm_constant_and_write_node_t;
|
738
|
+
|
739
|
+
// ConstantOperatorWriteNode
|
740
|
+
//
|
741
|
+
// Type: PM_CONSTANT_OPERATOR_WRITE_NODE
|
742
|
+
typedef struct pm_constant_operator_write_node {
|
743
|
+
pm_node_t base;
|
744
|
+
pm_constant_id_t name;
|
745
|
+
pm_location_t name_loc;
|
746
|
+
pm_location_t operator_loc;
|
747
|
+
struct pm_node *value;
|
748
|
+
pm_constant_id_t operator;
|
749
|
+
} pm_constant_operator_write_node_t;
|
750
|
+
|
751
|
+
// ConstantOrWriteNode
|
752
|
+
//
|
753
|
+
// Type: PM_CONSTANT_OR_WRITE_NODE
|
754
|
+
typedef struct pm_constant_or_write_node {
|
755
|
+
pm_node_t base;
|
756
|
+
pm_constant_id_t name;
|
757
|
+
pm_location_t name_loc;
|
758
|
+
pm_location_t operator_loc;
|
759
|
+
struct pm_node *value;
|
760
|
+
} pm_constant_or_write_node_t;
|
761
|
+
|
762
|
+
// ConstantPathAndWriteNode
|
763
|
+
//
|
764
|
+
// Type: PM_CONSTANT_PATH_AND_WRITE_NODE
|
765
|
+
typedef struct pm_constant_path_and_write_node {
|
766
|
+
pm_node_t base;
|
767
|
+
struct pm_constant_path_node *target;
|
768
|
+
pm_location_t operator_loc;
|
769
|
+
struct pm_node *value;
|
770
|
+
} pm_constant_path_and_write_node_t;
|
771
|
+
|
772
|
+
// ConstantPathNode
|
773
|
+
//
|
774
|
+
// Type: PM_CONSTANT_PATH_NODE
|
775
|
+
typedef struct pm_constant_path_node {
|
776
|
+
pm_node_t base;
|
777
|
+
struct pm_node *parent;
|
778
|
+
struct pm_node *child;
|
779
|
+
pm_location_t delimiter_loc;
|
780
|
+
} pm_constant_path_node_t;
|
781
|
+
|
782
|
+
// ConstantPathOperatorWriteNode
|
783
|
+
//
|
784
|
+
// Type: PM_CONSTANT_PATH_OPERATOR_WRITE_NODE
|
785
|
+
typedef struct pm_constant_path_operator_write_node {
|
786
|
+
pm_node_t base;
|
787
|
+
struct pm_constant_path_node *target;
|
788
|
+
pm_location_t operator_loc;
|
789
|
+
struct pm_node *value;
|
790
|
+
pm_constant_id_t operator;
|
791
|
+
} pm_constant_path_operator_write_node_t;
|
792
|
+
|
793
|
+
// ConstantPathOrWriteNode
|
794
|
+
//
|
795
|
+
// Type: PM_CONSTANT_PATH_OR_WRITE_NODE
|
796
|
+
typedef struct pm_constant_path_or_write_node {
|
797
|
+
pm_node_t base;
|
798
|
+
struct pm_constant_path_node *target;
|
799
|
+
pm_location_t operator_loc;
|
800
|
+
struct pm_node *value;
|
801
|
+
} pm_constant_path_or_write_node_t;
|
802
|
+
|
803
|
+
// ConstantPathTargetNode
|
804
|
+
//
|
805
|
+
// Type: PM_CONSTANT_PATH_TARGET_NODE
|
806
|
+
typedef struct pm_constant_path_target_node {
|
807
|
+
pm_node_t base;
|
808
|
+
struct pm_node *parent;
|
809
|
+
struct pm_node *child;
|
810
|
+
pm_location_t delimiter_loc;
|
811
|
+
} pm_constant_path_target_node_t;
|
812
|
+
|
813
|
+
// ConstantPathWriteNode
|
814
|
+
//
|
815
|
+
// Type: PM_CONSTANT_PATH_WRITE_NODE
|
816
|
+
typedef struct pm_constant_path_write_node {
|
817
|
+
pm_node_t base;
|
818
|
+
struct pm_constant_path_node *target;
|
819
|
+
pm_location_t operator_loc;
|
820
|
+
struct pm_node *value;
|
821
|
+
} pm_constant_path_write_node_t;
|
822
|
+
|
823
|
+
// ConstantReadNode
|
824
|
+
//
|
825
|
+
// Type: PM_CONSTANT_READ_NODE
|
826
|
+
typedef struct pm_constant_read_node {
|
827
|
+
pm_node_t base;
|
828
|
+
pm_constant_id_t name;
|
829
|
+
} pm_constant_read_node_t;
|
830
|
+
|
831
|
+
// ConstantTargetNode
|
832
|
+
//
|
833
|
+
// Type: PM_CONSTANT_TARGET_NODE
|
834
|
+
typedef struct pm_constant_target_node {
|
835
|
+
pm_node_t base;
|
836
|
+
pm_constant_id_t name;
|
837
|
+
} pm_constant_target_node_t;
|
838
|
+
|
839
|
+
// ConstantWriteNode
|
840
|
+
//
|
841
|
+
// Type: PM_CONSTANT_WRITE_NODE
|
842
|
+
typedef struct pm_constant_write_node {
|
843
|
+
pm_node_t base;
|
844
|
+
pm_constant_id_t name;
|
845
|
+
pm_location_t name_loc;
|
846
|
+
struct pm_node *value;
|
847
|
+
pm_location_t operator_loc;
|
848
|
+
} pm_constant_write_node_t;
|
849
|
+
|
850
|
+
// DefNode
|
851
|
+
//
|
852
|
+
// Type: PM_DEF_NODE
|
853
|
+
typedef struct pm_def_node {
|
854
|
+
pm_node_t base;
|
855
|
+
pm_constant_id_t name;
|
856
|
+
pm_location_t name_loc;
|
857
|
+
struct pm_node *receiver;
|
858
|
+
struct pm_parameters_node *parameters;
|
859
|
+
struct pm_node *body;
|
860
|
+
pm_constant_id_list_t locals;
|
861
|
+
pm_location_t def_keyword_loc;
|
862
|
+
pm_location_t operator_loc;
|
863
|
+
pm_location_t lparen_loc;
|
864
|
+
pm_location_t rparen_loc;
|
865
|
+
pm_location_t equal_loc;
|
866
|
+
pm_location_t end_keyword_loc;
|
867
|
+
} pm_def_node_t;
|
868
|
+
|
869
|
+
// DefinedNode
|
870
|
+
//
|
871
|
+
// Type: PM_DEFINED_NODE
|
872
|
+
typedef struct pm_defined_node {
|
873
|
+
pm_node_t base;
|
874
|
+
pm_location_t lparen_loc;
|
875
|
+
struct pm_node *value;
|
876
|
+
pm_location_t rparen_loc;
|
877
|
+
pm_location_t keyword_loc;
|
878
|
+
} pm_defined_node_t;
|
879
|
+
|
880
|
+
// ElseNode
|
881
|
+
//
|
882
|
+
// Type: PM_ELSE_NODE
|
883
|
+
typedef struct pm_else_node {
|
884
|
+
pm_node_t base;
|
885
|
+
pm_location_t else_keyword_loc;
|
886
|
+
struct pm_statements_node *statements;
|
887
|
+
pm_location_t end_keyword_loc;
|
888
|
+
} pm_else_node_t;
|
889
|
+
|
890
|
+
// EmbeddedStatementsNode
|
891
|
+
//
|
892
|
+
// Type: PM_EMBEDDED_STATEMENTS_NODE
|
893
|
+
typedef struct pm_embedded_statements_node {
|
894
|
+
pm_node_t base;
|
895
|
+
pm_location_t opening_loc;
|
896
|
+
struct pm_statements_node *statements;
|
897
|
+
pm_location_t closing_loc;
|
898
|
+
} pm_embedded_statements_node_t;
|
899
|
+
|
900
|
+
// EmbeddedVariableNode
|
901
|
+
//
|
902
|
+
// Type: PM_EMBEDDED_VARIABLE_NODE
|
903
|
+
typedef struct pm_embedded_variable_node {
|
904
|
+
pm_node_t base;
|
905
|
+
pm_location_t operator_loc;
|
906
|
+
struct pm_node *variable;
|
907
|
+
} pm_embedded_variable_node_t;
|
908
|
+
|
909
|
+
// EnsureNode
|
910
|
+
//
|
911
|
+
// Type: PM_ENSURE_NODE
|
912
|
+
typedef struct pm_ensure_node {
|
913
|
+
pm_node_t base;
|
914
|
+
pm_location_t ensure_keyword_loc;
|
915
|
+
struct pm_statements_node *statements;
|
916
|
+
pm_location_t end_keyword_loc;
|
917
|
+
} pm_ensure_node_t;
|
918
|
+
|
919
|
+
// FalseNode
|
920
|
+
//
|
921
|
+
// Type: PM_FALSE_NODE
|
922
|
+
typedef struct pm_false_node {
|
923
|
+
pm_node_t base;
|
924
|
+
} pm_false_node_t;
|
925
|
+
|
926
|
+
// FindPatternNode
|
927
|
+
//
|
928
|
+
// Type: PM_FIND_PATTERN_NODE
|
929
|
+
typedef struct pm_find_pattern_node {
|
930
|
+
pm_node_t base;
|
931
|
+
struct pm_node *constant;
|
932
|
+
struct pm_node *left;
|
933
|
+
struct pm_node_list requireds;
|
934
|
+
struct pm_node *right;
|
935
|
+
pm_location_t opening_loc;
|
936
|
+
pm_location_t closing_loc;
|
937
|
+
} pm_find_pattern_node_t;
|
938
|
+
|
939
|
+
// FlipFlopNode
|
940
|
+
//
|
941
|
+
// Type: PM_FLIP_FLOP_NODE
|
942
|
+
// Flags:
|
943
|
+
// PM_RANGE_FLAGS_EXCLUDE_END
|
944
|
+
typedef struct pm_flip_flop_node {
|
945
|
+
pm_node_t base;
|
946
|
+
struct pm_node *left;
|
947
|
+
struct pm_node *right;
|
948
|
+
pm_location_t operator_loc;
|
949
|
+
} pm_flip_flop_node_t;
|
950
|
+
|
951
|
+
// FloatNode
|
952
|
+
//
|
953
|
+
// Type: PM_FLOAT_NODE
|
954
|
+
typedef struct pm_float_node {
|
955
|
+
pm_node_t base;
|
956
|
+
} pm_float_node_t;
|
957
|
+
|
958
|
+
// ForNode
|
959
|
+
//
|
960
|
+
// Type: PM_FOR_NODE
|
961
|
+
typedef struct pm_for_node {
|
962
|
+
pm_node_t base;
|
963
|
+
struct pm_node *index;
|
964
|
+
struct pm_node *collection;
|
965
|
+
struct pm_statements_node *statements;
|
966
|
+
pm_location_t for_keyword_loc;
|
967
|
+
pm_location_t in_keyword_loc;
|
968
|
+
pm_location_t do_keyword_loc;
|
969
|
+
pm_location_t end_keyword_loc;
|
970
|
+
} pm_for_node_t;
|
971
|
+
|
972
|
+
// ForwardingArgumentsNode
|
973
|
+
//
|
974
|
+
// Type: PM_FORWARDING_ARGUMENTS_NODE
|
975
|
+
typedef struct pm_forwarding_arguments_node {
|
976
|
+
pm_node_t base;
|
977
|
+
} pm_forwarding_arguments_node_t;
|
978
|
+
|
979
|
+
// ForwardingParameterNode
|
980
|
+
//
|
981
|
+
// Type: PM_FORWARDING_PARAMETER_NODE
|
982
|
+
typedef struct pm_forwarding_parameter_node {
|
983
|
+
pm_node_t base;
|
984
|
+
} pm_forwarding_parameter_node_t;
|
985
|
+
|
986
|
+
// ForwardingSuperNode
|
987
|
+
//
|
988
|
+
// Type: PM_FORWARDING_SUPER_NODE
|
989
|
+
typedef struct pm_forwarding_super_node {
|
990
|
+
pm_node_t base;
|
991
|
+
struct pm_block_node *block;
|
992
|
+
} pm_forwarding_super_node_t;
|
993
|
+
|
994
|
+
// GlobalVariableAndWriteNode
|
995
|
+
//
|
996
|
+
// Type: PM_GLOBAL_VARIABLE_AND_WRITE_NODE
|
997
|
+
typedef struct pm_global_variable_and_write_node {
|
998
|
+
pm_node_t base;
|
999
|
+
pm_constant_id_t name;
|
1000
|
+
pm_location_t name_loc;
|
1001
|
+
pm_location_t operator_loc;
|
1002
|
+
struct pm_node *value;
|
1003
|
+
} pm_global_variable_and_write_node_t;
|
1004
|
+
|
1005
|
+
// GlobalVariableOperatorWriteNode
|
1006
|
+
//
|
1007
|
+
// Type: PM_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE
|
1008
|
+
typedef struct pm_global_variable_operator_write_node {
|
1009
|
+
pm_node_t base;
|
1010
|
+
pm_constant_id_t name;
|
1011
|
+
pm_location_t name_loc;
|
1012
|
+
pm_location_t operator_loc;
|
1013
|
+
struct pm_node *value;
|
1014
|
+
pm_constant_id_t operator;
|
1015
|
+
} pm_global_variable_operator_write_node_t;
|
1016
|
+
|
1017
|
+
// GlobalVariableOrWriteNode
|
1018
|
+
//
|
1019
|
+
// Type: PM_GLOBAL_VARIABLE_OR_WRITE_NODE
|
1020
|
+
typedef struct pm_global_variable_or_write_node {
|
1021
|
+
pm_node_t base;
|
1022
|
+
pm_constant_id_t name;
|
1023
|
+
pm_location_t name_loc;
|
1024
|
+
pm_location_t operator_loc;
|
1025
|
+
struct pm_node *value;
|
1026
|
+
} pm_global_variable_or_write_node_t;
|
1027
|
+
|
1028
|
+
// GlobalVariableReadNode
|
1029
|
+
//
|
1030
|
+
// Type: PM_GLOBAL_VARIABLE_READ_NODE
|
1031
|
+
typedef struct pm_global_variable_read_node {
|
1032
|
+
pm_node_t base;
|
1033
|
+
pm_constant_id_t name;
|
1034
|
+
} pm_global_variable_read_node_t;
|
1035
|
+
|
1036
|
+
// GlobalVariableTargetNode
|
1037
|
+
//
|
1038
|
+
// Type: PM_GLOBAL_VARIABLE_TARGET_NODE
|
1039
|
+
typedef struct pm_global_variable_target_node {
|
1040
|
+
pm_node_t base;
|
1041
|
+
pm_constant_id_t name;
|
1042
|
+
} pm_global_variable_target_node_t;
|
1043
|
+
|
1044
|
+
// GlobalVariableWriteNode
|
1045
|
+
//
|
1046
|
+
// Type: PM_GLOBAL_VARIABLE_WRITE_NODE
|
1047
|
+
typedef struct pm_global_variable_write_node {
|
1048
|
+
pm_node_t base;
|
1049
|
+
pm_constant_id_t name;
|
1050
|
+
pm_location_t name_loc;
|
1051
|
+
struct pm_node *value;
|
1052
|
+
pm_location_t operator_loc;
|
1053
|
+
} pm_global_variable_write_node_t;
|
1054
|
+
|
1055
|
+
// HashNode
|
1056
|
+
//
|
1057
|
+
// Type: PM_HASH_NODE
|
1058
|
+
typedef struct pm_hash_node {
|
1059
|
+
pm_node_t base;
|
1060
|
+
pm_location_t opening_loc;
|
1061
|
+
struct pm_node_list elements;
|
1062
|
+
pm_location_t closing_loc;
|
1063
|
+
} pm_hash_node_t;
|
1064
|
+
|
1065
|
+
// HashPatternNode
|
1066
|
+
//
|
1067
|
+
// Type: PM_HASH_PATTERN_NODE
|
1068
|
+
typedef struct pm_hash_pattern_node {
|
1069
|
+
pm_node_t base;
|
1070
|
+
struct pm_node *constant;
|
1071
|
+
struct pm_node_list assocs;
|
1072
|
+
struct pm_node *kwrest;
|
1073
|
+
pm_location_t opening_loc;
|
1074
|
+
pm_location_t closing_loc;
|
1075
|
+
} pm_hash_pattern_node_t;
|
1076
|
+
|
1077
|
+
// IfNode
|
1078
|
+
//
|
1079
|
+
// Type: PM_IF_NODE
|
1080
|
+
typedef struct pm_if_node {
|
1081
|
+
pm_node_t base;
|
1082
|
+
pm_location_t if_keyword_loc;
|
1083
|
+
struct pm_node *predicate;
|
1084
|
+
struct pm_statements_node *statements;
|
1085
|
+
struct pm_node *consequent;
|
1086
|
+
pm_location_t end_keyword_loc;
|
1087
|
+
} pm_if_node_t;
|
1088
|
+
|
1089
|
+
// ImaginaryNode
|
1090
|
+
//
|
1091
|
+
// Type: PM_IMAGINARY_NODE
|
1092
|
+
typedef struct pm_imaginary_node {
|
1093
|
+
pm_node_t base;
|
1094
|
+
struct pm_node *numeric;
|
1095
|
+
} pm_imaginary_node_t;
|
1096
|
+
|
1097
|
+
// ImplicitNode
|
1098
|
+
//
|
1099
|
+
// Type: PM_IMPLICIT_NODE
|
1100
|
+
typedef struct pm_implicit_node {
|
1101
|
+
pm_node_t base;
|
1102
|
+
struct pm_node *value;
|
1103
|
+
} pm_implicit_node_t;
|
1104
|
+
|
1105
|
+
// InNode
|
1106
|
+
//
|
1107
|
+
// Type: PM_IN_NODE
|
1108
|
+
typedef struct pm_in_node {
|
1109
|
+
pm_node_t base;
|
1110
|
+
struct pm_node *pattern;
|
1111
|
+
struct pm_statements_node *statements;
|
1112
|
+
pm_location_t in_loc;
|
1113
|
+
pm_location_t then_loc;
|
1114
|
+
} pm_in_node_t;
|
1115
|
+
|
1116
|
+
// InstanceVariableAndWriteNode
|
1117
|
+
//
|
1118
|
+
// Type: PM_INSTANCE_VARIABLE_AND_WRITE_NODE
|
1119
|
+
typedef struct pm_instance_variable_and_write_node {
|
1120
|
+
pm_node_t base;
|
1121
|
+
pm_constant_id_t name;
|
1122
|
+
pm_location_t name_loc;
|
1123
|
+
pm_location_t operator_loc;
|
1124
|
+
struct pm_node *value;
|
1125
|
+
} pm_instance_variable_and_write_node_t;
|
1126
|
+
|
1127
|
+
// InstanceVariableOperatorWriteNode
|
1128
|
+
//
|
1129
|
+
// Type: PM_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE
|
1130
|
+
typedef struct pm_instance_variable_operator_write_node {
|
1131
|
+
pm_node_t base;
|
1132
|
+
pm_constant_id_t name;
|
1133
|
+
pm_location_t name_loc;
|
1134
|
+
pm_location_t operator_loc;
|
1135
|
+
struct pm_node *value;
|
1136
|
+
pm_constant_id_t operator;
|
1137
|
+
} pm_instance_variable_operator_write_node_t;
|
1138
|
+
|
1139
|
+
// InstanceVariableOrWriteNode
|
1140
|
+
//
|
1141
|
+
// Type: PM_INSTANCE_VARIABLE_OR_WRITE_NODE
|
1142
|
+
typedef struct pm_instance_variable_or_write_node {
|
1143
|
+
pm_node_t base;
|
1144
|
+
pm_constant_id_t name;
|
1145
|
+
pm_location_t name_loc;
|
1146
|
+
pm_location_t operator_loc;
|
1147
|
+
struct pm_node *value;
|
1148
|
+
} pm_instance_variable_or_write_node_t;
|
1149
|
+
|
1150
|
+
// InstanceVariableReadNode
|
1151
|
+
//
|
1152
|
+
// Type: PM_INSTANCE_VARIABLE_READ_NODE
|
1153
|
+
typedef struct pm_instance_variable_read_node {
|
1154
|
+
pm_node_t base;
|
1155
|
+
pm_constant_id_t name;
|
1156
|
+
} pm_instance_variable_read_node_t;
|
1157
|
+
|
1158
|
+
// InstanceVariableTargetNode
|
1159
|
+
//
|
1160
|
+
// Type: PM_INSTANCE_VARIABLE_TARGET_NODE
|
1161
|
+
typedef struct pm_instance_variable_target_node {
|
1162
|
+
pm_node_t base;
|
1163
|
+
pm_constant_id_t name;
|
1164
|
+
} pm_instance_variable_target_node_t;
|
1165
|
+
|
1166
|
+
// InstanceVariableWriteNode
|
1167
|
+
//
|
1168
|
+
// Type: PM_INSTANCE_VARIABLE_WRITE_NODE
|
1169
|
+
typedef struct pm_instance_variable_write_node {
|
1170
|
+
pm_node_t base;
|
1171
|
+
pm_constant_id_t name;
|
1172
|
+
pm_location_t name_loc;
|
1173
|
+
struct pm_node *value;
|
1174
|
+
pm_location_t operator_loc;
|
1175
|
+
} pm_instance_variable_write_node_t;
|
1176
|
+
|
1177
|
+
// IntegerNode
|
1178
|
+
//
|
1179
|
+
// Type: PM_INTEGER_NODE
|
1180
|
+
// Flags:
|
1181
|
+
// PM_INTEGER_BASE_FLAGS_BINARY
|
1182
|
+
// PM_INTEGER_BASE_FLAGS_OCTAL
|
1183
|
+
// PM_INTEGER_BASE_FLAGS_DECIMAL
|
1184
|
+
// PM_INTEGER_BASE_FLAGS_HEXADECIMAL
|
1185
|
+
typedef struct pm_integer_node {
|
1186
|
+
pm_node_t base;
|
1187
|
+
} pm_integer_node_t;
|
1188
|
+
|
1189
|
+
// InterpolatedMatchLastLineNode
|
1190
|
+
//
|
1191
|
+
// Type: PM_INTERPOLATED_MATCH_LAST_LINE_NODE
|
1192
|
+
// Flags:
|
1193
|
+
// PM_REGULAR_EXPRESSION_FLAGS_IGNORE_CASE
|
1194
|
+
// PM_REGULAR_EXPRESSION_FLAGS_EXTENDED
|
1195
|
+
// PM_REGULAR_EXPRESSION_FLAGS_MULTI_LINE
|
1196
|
+
// PM_REGULAR_EXPRESSION_FLAGS_EUC_JP
|
1197
|
+
// PM_REGULAR_EXPRESSION_FLAGS_ASCII_8BIT
|
1198
|
+
// PM_REGULAR_EXPRESSION_FLAGS_WINDOWS_31J
|
1199
|
+
// PM_REGULAR_EXPRESSION_FLAGS_UTF_8
|
1200
|
+
// PM_REGULAR_EXPRESSION_FLAGS_ONCE
|
1201
|
+
typedef struct pm_interpolated_match_last_line_node {
|
1202
|
+
pm_node_t base;
|
1203
|
+
pm_location_t opening_loc;
|
1204
|
+
struct pm_node_list parts;
|
1205
|
+
pm_location_t closing_loc;
|
1206
|
+
} pm_interpolated_match_last_line_node_t;
|
1207
|
+
|
1208
|
+
// InterpolatedRegularExpressionNode
|
1209
|
+
//
|
1210
|
+
// Type: PM_INTERPOLATED_REGULAR_EXPRESSION_NODE
|
1211
|
+
// Flags:
|
1212
|
+
// PM_REGULAR_EXPRESSION_FLAGS_IGNORE_CASE
|
1213
|
+
// PM_REGULAR_EXPRESSION_FLAGS_EXTENDED
|
1214
|
+
// PM_REGULAR_EXPRESSION_FLAGS_MULTI_LINE
|
1215
|
+
// PM_REGULAR_EXPRESSION_FLAGS_EUC_JP
|
1216
|
+
// PM_REGULAR_EXPRESSION_FLAGS_ASCII_8BIT
|
1217
|
+
// PM_REGULAR_EXPRESSION_FLAGS_WINDOWS_31J
|
1218
|
+
// PM_REGULAR_EXPRESSION_FLAGS_UTF_8
|
1219
|
+
// PM_REGULAR_EXPRESSION_FLAGS_ONCE
|
1220
|
+
typedef struct pm_interpolated_regular_expression_node {
|
1221
|
+
pm_node_t base;
|
1222
|
+
pm_location_t opening_loc;
|
1223
|
+
struct pm_node_list parts;
|
1224
|
+
pm_location_t closing_loc;
|
1225
|
+
} pm_interpolated_regular_expression_node_t;
|
1226
|
+
|
1227
|
+
// InterpolatedStringNode
|
1228
|
+
//
|
1229
|
+
// Type: PM_INTERPOLATED_STRING_NODE
|
1230
|
+
typedef struct pm_interpolated_string_node {
|
1231
|
+
pm_node_t base;
|
1232
|
+
pm_location_t opening_loc;
|
1233
|
+
struct pm_node_list parts;
|
1234
|
+
pm_location_t closing_loc;
|
1235
|
+
} pm_interpolated_string_node_t;
|
1236
|
+
|
1237
|
+
// InterpolatedSymbolNode
|
1238
|
+
//
|
1239
|
+
// Type: PM_INTERPOLATED_SYMBOL_NODE
|
1240
|
+
typedef struct pm_interpolated_symbol_node {
|
1241
|
+
pm_node_t base;
|
1242
|
+
pm_location_t opening_loc;
|
1243
|
+
struct pm_node_list parts;
|
1244
|
+
pm_location_t closing_loc;
|
1245
|
+
} pm_interpolated_symbol_node_t;
|
1246
|
+
|
1247
|
+
// InterpolatedXStringNode
|
1248
|
+
//
|
1249
|
+
// Type: PM_INTERPOLATED_X_STRING_NODE
|
1250
|
+
typedef struct pm_interpolated_x_string_node {
|
1251
|
+
pm_node_t base;
|
1252
|
+
pm_location_t opening_loc;
|
1253
|
+
struct pm_node_list parts;
|
1254
|
+
pm_location_t closing_loc;
|
1255
|
+
} pm_interpolated_x_string_node_t;
|
1256
|
+
|
1257
|
+
// KeywordHashNode
|
1258
|
+
//
|
1259
|
+
// Type: PM_KEYWORD_HASH_NODE
|
1260
|
+
typedef struct pm_keyword_hash_node {
|
1261
|
+
pm_node_t base;
|
1262
|
+
struct pm_node_list elements;
|
1263
|
+
} pm_keyword_hash_node_t;
|
1264
|
+
|
1265
|
+
// KeywordParameterNode
|
1266
|
+
//
|
1267
|
+
// Type: PM_KEYWORD_PARAMETER_NODE
|
1268
|
+
typedef struct pm_keyword_parameter_node {
|
1269
|
+
pm_node_t base;
|
1270
|
+
pm_constant_id_t name;
|
1271
|
+
pm_location_t name_loc;
|
1272
|
+
struct pm_node *value;
|
1273
|
+
} pm_keyword_parameter_node_t;
|
1274
|
+
|
1275
|
+
// KeywordRestParameterNode
|
1276
|
+
//
|
1277
|
+
// Type: PM_KEYWORD_REST_PARAMETER_NODE
|
1278
|
+
typedef struct pm_keyword_rest_parameter_node {
|
1279
|
+
pm_node_t base;
|
1280
|
+
pm_constant_id_t name;
|
1281
|
+
pm_location_t name_loc;
|
1282
|
+
pm_location_t operator_loc;
|
1283
|
+
} pm_keyword_rest_parameter_node_t;
|
1284
|
+
|
1285
|
+
// LambdaNode
|
1286
|
+
//
|
1287
|
+
// Type: PM_LAMBDA_NODE
|
1288
|
+
typedef struct pm_lambda_node {
|
1289
|
+
pm_node_t base;
|
1290
|
+
pm_constant_id_list_t locals;
|
1291
|
+
pm_location_t operator_loc;
|
1292
|
+
pm_location_t opening_loc;
|
1293
|
+
pm_location_t closing_loc;
|
1294
|
+
struct pm_block_parameters_node *parameters;
|
1295
|
+
struct pm_node *body;
|
1296
|
+
} pm_lambda_node_t;
|
1297
|
+
|
1298
|
+
// LocalVariableAndWriteNode
|
1299
|
+
//
|
1300
|
+
// Type: PM_LOCAL_VARIABLE_AND_WRITE_NODE
|
1301
|
+
typedef struct pm_local_variable_and_write_node {
|
1302
|
+
pm_node_t base;
|
1303
|
+
pm_location_t name_loc;
|
1304
|
+
pm_location_t operator_loc;
|
1305
|
+
struct pm_node *value;
|
1306
|
+
pm_constant_id_t name;
|
1307
|
+
uint32_t depth;
|
1308
|
+
} pm_local_variable_and_write_node_t;
|
1309
|
+
|
1310
|
+
// LocalVariableOperatorWriteNode
|
1311
|
+
//
|
1312
|
+
// Type: PM_LOCAL_VARIABLE_OPERATOR_WRITE_NODE
|
1313
|
+
typedef struct pm_local_variable_operator_write_node {
|
1314
|
+
pm_node_t base;
|
1315
|
+
pm_location_t name_loc;
|
1316
|
+
pm_location_t operator_loc;
|
1317
|
+
struct pm_node *value;
|
1318
|
+
pm_constant_id_t name;
|
1319
|
+
pm_constant_id_t operator;
|
1320
|
+
uint32_t depth;
|
1321
|
+
} pm_local_variable_operator_write_node_t;
|
1322
|
+
|
1323
|
+
// LocalVariableOrWriteNode
|
1324
|
+
//
|
1325
|
+
// Type: PM_LOCAL_VARIABLE_OR_WRITE_NODE
|
1326
|
+
typedef struct pm_local_variable_or_write_node {
|
1327
|
+
pm_node_t base;
|
1328
|
+
pm_location_t name_loc;
|
1329
|
+
pm_location_t operator_loc;
|
1330
|
+
struct pm_node *value;
|
1331
|
+
pm_constant_id_t name;
|
1332
|
+
uint32_t depth;
|
1333
|
+
} pm_local_variable_or_write_node_t;
|
1334
|
+
|
1335
|
+
// LocalVariableReadNode
|
1336
|
+
//
|
1337
|
+
// Type: PM_LOCAL_VARIABLE_READ_NODE
|
1338
|
+
typedef struct pm_local_variable_read_node {
|
1339
|
+
pm_node_t base;
|
1340
|
+
pm_constant_id_t name;
|
1341
|
+
uint32_t depth;
|
1342
|
+
} pm_local_variable_read_node_t;
|
1343
|
+
|
1344
|
+
// LocalVariableTargetNode
|
1345
|
+
//
|
1346
|
+
// Type: PM_LOCAL_VARIABLE_TARGET_NODE
|
1347
|
+
typedef struct pm_local_variable_target_node {
|
1348
|
+
pm_node_t base;
|
1349
|
+
pm_constant_id_t name;
|
1350
|
+
uint32_t depth;
|
1351
|
+
} pm_local_variable_target_node_t;
|
1352
|
+
|
1353
|
+
// LocalVariableWriteNode
|
1354
|
+
//
|
1355
|
+
// Type: PM_LOCAL_VARIABLE_WRITE_NODE
|
1356
|
+
typedef struct pm_local_variable_write_node {
|
1357
|
+
pm_node_t base;
|
1358
|
+
pm_constant_id_t name;
|
1359
|
+
uint32_t depth;
|
1360
|
+
pm_location_t name_loc;
|
1361
|
+
struct pm_node *value;
|
1362
|
+
pm_location_t operator_loc;
|
1363
|
+
} pm_local_variable_write_node_t;
|
1364
|
+
|
1365
|
+
// MatchLastLineNode
|
1366
|
+
//
|
1367
|
+
// Type: PM_MATCH_LAST_LINE_NODE
|
1368
|
+
// Flags:
|
1369
|
+
// PM_REGULAR_EXPRESSION_FLAGS_IGNORE_CASE
|
1370
|
+
// PM_REGULAR_EXPRESSION_FLAGS_EXTENDED
|
1371
|
+
// PM_REGULAR_EXPRESSION_FLAGS_MULTI_LINE
|
1372
|
+
// PM_REGULAR_EXPRESSION_FLAGS_EUC_JP
|
1373
|
+
// PM_REGULAR_EXPRESSION_FLAGS_ASCII_8BIT
|
1374
|
+
// PM_REGULAR_EXPRESSION_FLAGS_WINDOWS_31J
|
1375
|
+
// PM_REGULAR_EXPRESSION_FLAGS_UTF_8
|
1376
|
+
// PM_REGULAR_EXPRESSION_FLAGS_ONCE
|
1377
|
+
typedef struct pm_match_last_line_node {
|
1378
|
+
pm_node_t base;
|
1379
|
+
pm_location_t opening_loc;
|
1380
|
+
pm_location_t content_loc;
|
1381
|
+
pm_location_t closing_loc;
|
1382
|
+
pm_string_t unescaped;
|
1383
|
+
} pm_match_last_line_node_t;
|
1384
|
+
|
1385
|
+
// MatchPredicateNode
|
1386
|
+
//
|
1387
|
+
// Type: PM_MATCH_PREDICATE_NODE
|
1388
|
+
typedef struct pm_match_predicate_node {
|
1389
|
+
pm_node_t base;
|
1390
|
+
struct pm_node *value;
|
1391
|
+
struct pm_node *pattern;
|
1392
|
+
pm_location_t operator_loc;
|
1393
|
+
} pm_match_predicate_node_t;
|
1394
|
+
|
1395
|
+
// MatchRequiredNode
|
1396
|
+
//
|
1397
|
+
// Type: PM_MATCH_REQUIRED_NODE
|
1398
|
+
typedef struct pm_match_required_node {
|
1399
|
+
pm_node_t base;
|
1400
|
+
struct pm_node *value;
|
1401
|
+
struct pm_node *pattern;
|
1402
|
+
pm_location_t operator_loc;
|
1403
|
+
} pm_match_required_node_t;
|
1404
|
+
|
1405
|
+
// MatchWriteNode
|
1406
|
+
//
|
1407
|
+
// Type: PM_MATCH_WRITE_NODE
|
1408
|
+
typedef struct pm_match_write_node {
|
1409
|
+
pm_node_t base;
|
1410
|
+
struct pm_call_node *call;
|
1411
|
+
pm_constant_id_list_t locals;
|
1412
|
+
} pm_match_write_node_t;
|
1413
|
+
|
1414
|
+
// MissingNode
|
1415
|
+
//
|
1416
|
+
// Type: PM_MISSING_NODE
|
1417
|
+
typedef struct pm_missing_node {
|
1418
|
+
pm_node_t base;
|
1419
|
+
} pm_missing_node_t;
|
1420
|
+
|
1421
|
+
// ModuleNode
|
1422
|
+
//
|
1423
|
+
// Type: PM_MODULE_NODE
|
1424
|
+
typedef struct pm_module_node {
|
1425
|
+
pm_node_t base;
|
1426
|
+
pm_constant_id_list_t locals;
|
1427
|
+
pm_location_t module_keyword_loc;
|
1428
|
+
struct pm_node *constant_path;
|
1429
|
+
struct pm_node *body;
|
1430
|
+
pm_location_t end_keyword_loc;
|
1431
|
+
pm_constant_id_t name;
|
1432
|
+
} pm_module_node_t;
|
1433
|
+
|
1434
|
+
// MultiTargetNode
|
1435
|
+
//
|
1436
|
+
// Type: PM_MULTI_TARGET_NODE
|
1437
|
+
typedef struct pm_multi_target_node {
|
1438
|
+
pm_node_t base;
|
1439
|
+
struct pm_node_list targets;
|
1440
|
+
pm_location_t lparen_loc;
|
1441
|
+
pm_location_t rparen_loc;
|
1442
|
+
} pm_multi_target_node_t;
|
1443
|
+
|
1444
|
+
// MultiWriteNode
|
1445
|
+
//
|
1446
|
+
// Type: PM_MULTI_WRITE_NODE
|
1447
|
+
typedef struct pm_multi_write_node {
|
1448
|
+
pm_node_t base;
|
1449
|
+
struct pm_node_list targets;
|
1450
|
+
pm_location_t lparen_loc;
|
1451
|
+
pm_location_t rparen_loc;
|
1452
|
+
pm_location_t operator_loc;
|
1453
|
+
struct pm_node *value;
|
1454
|
+
} pm_multi_write_node_t;
|
1455
|
+
|
1456
|
+
// NextNode
|
1457
|
+
//
|
1458
|
+
// Type: PM_NEXT_NODE
|
1459
|
+
typedef struct pm_next_node {
|
1460
|
+
pm_node_t base;
|
1461
|
+
struct pm_arguments_node *arguments;
|
1462
|
+
pm_location_t keyword_loc;
|
1463
|
+
} pm_next_node_t;
|
1464
|
+
|
1465
|
+
// NilNode
|
1466
|
+
//
|
1467
|
+
// Type: PM_NIL_NODE
|
1468
|
+
typedef struct pm_nil_node {
|
1469
|
+
pm_node_t base;
|
1470
|
+
} pm_nil_node_t;
|
1471
|
+
|
1472
|
+
// NoKeywordsParameterNode
|
1473
|
+
//
|
1474
|
+
// Type: PM_NO_KEYWORDS_PARAMETER_NODE
|
1475
|
+
typedef struct pm_no_keywords_parameter_node {
|
1476
|
+
pm_node_t base;
|
1477
|
+
pm_location_t operator_loc;
|
1478
|
+
pm_location_t keyword_loc;
|
1479
|
+
} pm_no_keywords_parameter_node_t;
|
1480
|
+
|
1481
|
+
// NumberedReferenceReadNode
|
1482
|
+
//
|
1483
|
+
// Type: PM_NUMBERED_REFERENCE_READ_NODE
|
1484
|
+
typedef struct pm_numbered_reference_read_node {
|
1485
|
+
pm_node_t base;
|
1486
|
+
uint32_t number;
|
1487
|
+
} pm_numbered_reference_read_node_t;
|
1488
|
+
|
1489
|
+
// OptionalParameterNode
|
1490
|
+
//
|
1491
|
+
// Type: PM_OPTIONAL_PARAMETER_NODE
|
1492
|
+
typedef struct pm_optional_parameter_node {
|
1493
|
+
pm_node_t base;
|
1494
|
+
pm_constant_id_t name;
|
1495
|
+
pm_location_t name_loc;
|
1496
|
+
pm_location_t operator_loc;
|
1497
|
+
struct pm_node *value;
|
1498
|
+
} pm_optional_parameter_node_t;
|
1499
|
+
|
1500
|
+
// OrNode
|
1501
|
+
//
|
1502
|
+
// Type: PM_OR_NODE
|
1503
|
+
typedef struct pm_or_node {
|
1504
|
+
pm_node_t base;
|
1505
|
+
struct pm_node *left;
|
1506
|
+
struct pm_node *right;
|
1507
|
+
pm_location_t operator_loc;
|
1508
|
+
} pm_or_node_t;
|
1509
|
+
|
1510
|
+
// ParametersNode
|
1511
|
+
//
|
1512
|
+
// Type: PM_PARAMETERS_NODE
|
1513
|
+
typedef struct pm_parameters_node {
|
1514
|
+
pm_node_t base;
|
1515
|
+
struct pm_node_list requireds;
|
1516
|
+
struct pm_node_list optionals;
|
1517
|
+
struct pm_rest_parameter_node *rest;
|
1518
|
+
struct pm_node_list posts;
|
1519
|
+
struct pm_node_list keywords;
|
1520
|
+
struct pm_node *keyword_rest;
|
1521
|
+
struct pm_block_parameter_node *block;
|
1522
|
+
} pm_parameters_node_t;
|
1523
|
+
|
1524
|
+
// ParenthesesNode
|
1525
|
+
//
|
1526
|
+
// Type: PM_PARENTHESES_NODE
|
1527
|
+
typedef struct pm_parentheses_node {
|
1528
|
+
pm_node_t base;
|
1529
|
+
struct pm_node *body;
|
1530
|
+
pm_location_t opening_loc;
|
1531
|
+
pm_location_t closing_loc;
|
1532
|
+
} pm_parentheses_node_t;
|
1533
|
+
|
1534
|
+
// PinnedExpressionNode
|
1535
|
+
//
|
1536
|
+
// Type: PM_PINNED_EXPRESSION_NODE
|
1537
|
+
typedef struct pm_pinned_expression_node {
|
1538
|
+
pm_node_t base;
|
1539
|
+
struct pm_node *expression;
|
1540
|
+
pm_location_t operator_loc;
|
1541
|
+
pm_location_t lparen_loc;
|
1542
|
+
pm_location_t rparen_loc;
|
1543
|
+
} pm_pinned_expression_node_t;
|
1544
|
+
|
1545
|
+
// PinnedVariableNode
|
1546
|
+
//
|
1547
|
+
// Type: PM_PINNED_VARIABLE_NODE
|
1548
|
+
typedef struct pm_pinned_variable_node {
|
1549
|
+
pm_node_t base;
|
1550
|
+
struct pm_node *variable;
|
1551
|
+
pm_location_t operator_loc;
|
1552
|
+
} pm_pinned_variable_node_t;
|
1553
|
+
|
1554
|
+
// PostExecutionNode
|
1555
|
+
//
|
1556
|
+
// Type: PM_POST_EXECUTION_NODE
|
1557
|
+
typedef struct pm_post_execution_node {
|
1558
|
+
pm_node_t base;
|
1559
|
+
struct pm_statements_node *statements;
|
1560
|
+
pm_location_t keyword_loc;
|
1561
|
+
pm_location_t opening_loc;
|
1562
|
+
pm_location_t closing_loc;
|
1563
|
+
} pm_post_execution_node_t;
|
1564
|
+
|
1565
|
+
// PreExecutionNode
|
1566
|
+
//
|
1567
|
+
// Type: PM_PRE_EXECUTION_NODE
|
1568
|
+
typedef struct pm_pre_execution_node {
|
1569
|
+
pm_node_t base;
|
1570
|
+
struct pm_statements_node *statements;
|
1571
|
+
pm_location_t keyword_loc;
|
1572
|
+
pm_location_t opening_loc;
|
1573
|
+
pm_location_t closing_loc;
|
1574
|
+
} pm_pre_execution_node_t;
|
1575
|
+
|
1576
|
+
// ProgramNode
|
1577
|
+
//
|
1578
|
+
// Type: PM_PROGRAM_NODE
|
1579
|
+
typedef struct pm_program_node {
|
1580
|
+
pm_node_t base;
|
1581
|
+
pm_constant_id_list_t locals;
|
1582
|
+
struct pm_statements_node *statements;
|
1583
|
+
} pm_program_node_t;
|
1584
|
+
|
1585
|
+
// RangeNode
|
1586
|
+
//
|
1587
|
+
// Type: PM_RANGE_NODE
|
1588
|
+
// Flags:
|
1589
|
+
// PM_RANGE_FLAGS_EXCLUDE_END
|
1590
|
+
typedef struct pm_range_node {
|
1591
|
+
pm_node_t base;
|
1592
|
+
struct pm_node *left;
|
1593
|
+
struct pm_node *right;
|
1594
|
+
pm_location_t operator_loc;
|
1595
|
+
} pm_range_node_t;
|
1596
|
+
|
1597
|
+
// RationalNode
|
1598
|
+
//
|
1599
|
+
// Type: PM_RATIONAL_NODE
|
1600
|
+
typedef struct pm_rational_node {
|
1601
|
+
pm_node_t base;
|
1602
|
+
struct pm_node *numeric;
|
1603
|
+
} pm_rational_node_t;
|
1604
|
+
|
1605
|
+
// RedoNode
|
1606
|
+
//
|
1607
|
+
// Type: PM_REDO_NODE
|
1608
|
+
typedef struct pm_redo_node {
|
1609
|
+
pm_node_t base;
|
1610
|
+
} pm_redo_node_t;
|
1611
|
+
|
1612
|
+
// RegularExpressionNode
|
1613
|
+
//
|
1614
|
+
// Type: PM_REGULAR_EXPRESSION_NODE
|
1615
|
+
// Flags:
|
1616
|
+
// PM_REGULAR_EXPRESSION_FLAGS_IGNORE_CASE
|
1617
|
+
// PM_REGULAR_EXPRESSION_FLAGS_EXTENDED
|
1618
|
+
// PM_REGULAR_EXPRESSION_FLAGS_MULTI_LINE
|
1619
|
+
// PM_REGULAR_EXPRESSION_FLAGS_EUC_JP
|
1620
|
+
// PM_REGULAR_EXPRESSION_FLAGS_ASCII_8BIT
|
1621
|
+
// PM_REGULAR_EXPRESSION_FLAGS_WINDOWS_31J
|
1622
|
+
// PM_REGULAR_EXPRESSION_FLAGS_UTF_8
|
1623
|
+
// PM_REGULAR_EXPRESSION_FLAGS_ONCE
|
1624
|
+
typedef struct pm_regular_expression_node {
|
1625
|
+
pm_node_t base;
|
1626
|
+
pm_location_t opening_loc;
|
1627
|
+
pm_location_t content_loc;
|
1628
|
+
pm_location_t closing_loc;
|
1629
|
+
pm_string_t unescaped;
|
1630
|
+
} pm_regular_expression_node_t;
|
1631
|
+
|
1632
|
+
// RequiredDestructuredParameterNode
|
1633
|
+
//
|
1634
|
+
// Type: PM_REQUIRED_DESTRUCTURED_PARAMETER_NODE
|
1635
|
+
typedef struct pm_required_destructured_parameter_node {
|
1636
|
+
pm_node_t base;
|
1637
|
+
struct pm_node_list parameters;
|
1638
|
+
pm_location_t opening_loc;
|
1639
|
+
pm_location_t closing_loc;
|
1640
|
+
} pm_required_destructured_parameter_node_t;
|
1641
|
+
|
1642
|
+
// RequiredParameterNode
|
1643
|
+
//
|
1644
|
+
// Type: PM_REQUIRED_PARAMETER_NODE
|
1645
|
+
typedef struct pm_required_parameter_node {
|
1646
|
+
pm_node_t base;
|
1647
|
+
pm_constant_id_t name;
|
1648
|
+
} pm_required_parameter_node_t;
|
1649
|
+
|
1650
|
+
// RescueModifierNode
|
1651
|
+
//
|
1652
|
+
// Type: PM_RESCUE_MODIFIER_NODE
|
1653
|
+
typedef struct pm_rescue_modifier_node {
|
1654
|
+
pm_node_t base;
|
1655
|
+
struct pm_node *expression;
|
1656
|
+
pm_location_t keyword_loc;
|
1657
|
+
struct pm_node *rescue_expression;
|
1658
|
+
} pm_rescue_modifier_node_t;
|
1659
|
+
|
1660
|
+
// RescueNode
|
1661
|
+
//
|
1662
|
+
// Type: PM_RESCUE_NODE
|
1663
|
+
typedef struct pm_rescue_node {
|
1664
|
+
pm_node_t base;
|
1665
|
+
pm_location_t keyword_loc;
|
1666
|
+
struct pm_node_list exceptions;
|
1667
|
+
pm_location_t operator_loc;
|
1668
|
+
struct pm_node *reference;
|
1669
|
+
struct pm_statements_node *statements;
|
1670
|
+
struct pm_rescue_node *consequent;
|
1671
|
+
} pm_rescue_node_t;
|
1672
|
+
|
1673
|
+
// RestParameterNode
|
1674
|
+
//
|
1675
|
+
// Type: PM_REST_PARAMETER_NODE
|
1676
|
+
typedef struct pm_rest_parameter_node {
|
1677
|
+
pm_node_t base;
|
1678
|
+
pm_constant_id_t name;
|
1679
|
+
pm_location_t name_loc;
|
1680
|
+
pm_location_t operator_loc;
|
1681
|
+
} pm_rest_parameter_node_t;
|
1682
|
+
|
1683
|
+
// RetryNode
|
1684
|
+
//
|
1685
|
+
// Type: PM_RETRY_NODE
|
1686
|
+
typedef struct pm_retry_node {
|
1687
|
+
pm_node_t base;
|
1688
|
+
} pm_retry_node_t;
|
1689
|
+
|
1690
|
+
// ReturnNode
|
1691
|
+
//
|
1692
|
+
// Type: PM_RETURN_NODE
|
1693
|
+
typedef struct pm_return_node {
|
1694
|
+
pm_node_t base;
|
1695
|
+
pm_location_t keyword_loc;
|
1696
|
+
struct pm_arguments_node *arguments;
|
1697
|
+
} pm_return_node_t;
|
1698
|
+
|
1699
|
+
// SelfNode
|
1700
|
+
//
|
1701
|
+
// Type: PM_SELF_NODE
|
1702
|
+
typedef struct pm_self_node {
|
1703
|
+
pm_node_t base;
|
1704
|
+
} pm_self_node_t;
|
1705
|
+
|
1706
|
+
// SingletonClassNode
|
1707
|
+
//
|
1708
|
+
// Type: PM_SINGLETON_CLASS_NODE
|
1709
|
+
typedef struct pm_singleton_class_node {
|
1710
|
+
pm_node_t base;
|
1711
|
+
pm_constant_id_list_t locals;
|
1712
|
+
pm_location_t class_keyword_loc;
|
1713
|
+
pm_location_t operator_loc;
|
1714
|
+
struct pm_node *expression;
|
1715
|
+
struct pm_node *body;
|
1716
|
+
pm_location_t end_keyword_loc;
|
1717
|
+
} pm_singleton_class_node_t;
|
1718
|
+
|
1719
|
+
// SourceEncodingNode
|
1720
|
+
//
|
1721
|
+
// Type: PM_SOURCE_ENCODING_NODE
|
1722
|
+
typedef struct pm_source_encoding_node {
|
1723
|
+
pm_node_t base;
|
1724
|
+
} pm_source_encoding_node_t;
|
1725
|
+
|
1726
|
+
// SourceFileNode
|
1727
|
+
//
|
1728
|
+
// Type: PM_SOURCE_FILE_NODE
|
1729
|
+
typedef struct pm_source_file_node {
|
1730
|
+
pm_node_t base;
|
1731
|
+
pm_string_t filepath;
|
1732
|
+
} pm_source_file_node_t;
|
1733
|
+
|
1734
|
+
// SourceLineNode
|
1735
|
+
//
|
1736
|
+
// Type: PM_SOURCE_LINE_NODE
|
1737
|
+
typedef struct pm_source_line_node {
|
1738
|
+
pm_node_t base;
|
1739
|
+
} pm_source_line_node_t;
|
1740
|
+
|
1741
|
+
// SplatNode
|
1742
|
+
//
|
1743
|
+
// Type: PM_SPLAT_NODE
|
1744
|
+
typedef struct pm_splat_node {
|
1745
|
+
pm_node_t base;
|
1746
|
+
pm_location_t operator_loc;
|
1747
|
+
struct pm_node *expression;
|
1748
|
+
} pm_splat_node_t;
|
1749
|
+
|
1750
|
+
// StatementsNode
|
1751
|
+
//
|
1752
|
+
// Type: PM_STATEMENTS_NODE
|
1753
|
+
typedef struct pm_statements_node {
|
1754
|
+
pm_node_t base;
|
1755
|
+
struct pm_node_list body;
|
1756
|
+
} pm_statements_node_t;
|
1757
|
+
|
1758
|
+
// StringConcatNode
|
1759
|
+
//
|
1760
|
+
// Type: PM_STRING_CONCAT_NODE
|
1761
|
+
typedef struct pm_string_concat_node {
|
1762
|
+
pm_node_t base;
|
1763
|
+
struct pm_node *left;
|
1764
|
+
struct pm_node *right;
|
1765
|
+
} pm_string_concat_node_t;
|
1766
|
+
|
1767
|
+
// StringNode
|
1768
|
+
//
|
1769
|
+
// Type: PM_STRING_NODE
|
1770
|
+
// Flags:
|
1771
|
+
// PM_STRING_FLAGS_FROZEN
|
1772
|
+
typedef struct pm_string_node {
|
1773
|
+
pm_node_t base;
|
1774
|
+
pm_location_t opening_loc;
|
1775
|
+
pm_location_t content_loc;
|
1776
|
+
pm_location_t closing_loc;
|
1777
|
+
pm_string_t unescaped;
|
1778
|
+
} pm_string_node_t;
|
1779
|
+
|
1780
|
+
// SuperNode
|
1781
|
+
//
|
1782
|
+
// Type: PM_SUPER_NODE
|
1783
|
+
typedef struct pm_super_node {
|
1784
|
+
pm_node_t base;
|
1785
|
+
pm_location_t keyword_loc;
|
1786
|
+
pm_location_t lparen_loc;
|
1787
|
+
struct pm_arguments_node *arguments;
|
1788
|
+
pm_location_t rparen_loc;
|
1789
|
+
struct pm_node *block;
|
1790
|
+
} pm_super_node_t;
|
1791
|
+
|
1792
|
+
// SymbolNode
|
1793
|
+
//
|
1794
|
+
// Type: PM_SYMBOL_NODE
|
1795
|
+
typedef struct pm_symbol_node {
|
1796
|
+
pm_node_t base;
|
1797
|
+
pm_location_t opening_loc;
|
1798
|
+
pm_location_t value_loc;
|
1799
|
+
pm_location_t closing_loc;
|
1800
|
+
pm_string_t unescaped;
|
1801
|
+
} pm_symbol_node_t;
|
1802
|
+
|
1803
|
+
// TrueNode
|
1804
|
+
//
|
1805
|
+
// Type: PM_TRUE_NODE
|
1806
|
+
typedef struct pm_true_node {
|
1807
|
+
pm_node_t base;
|
1808
|
+
} pm_true_node_t;
|
1809
|
+
|
1810
|
+
// UndefNode
|
1811
|
+
//
|
1812
|
+
// Type: PM_UNDEF_NODE
|
1813
|
+
typedef struct pm_undef_node {
|
1814
|
+
pm_node_t base;
|
1815
|
+
struct pm_node_list names;
|
1816
|
+
pm_location_t keyword_loc;
|
1817
|
+
} pm_undef_node_t;
|
1818
|
+
|
1819
|
+
// UnlessNode
|
1820
|
+
//
|
1821
|
+
// Type: PM_UNLESS_NODE
|
1822
|
+
typedef struct pm_unless_node {
|
1823
|
+
pm_node_t base;
|
1824
|
+
pm_location_t keyword_loc;
|
1825
|
+
struct pm_node *predicate;
|
1826
|
+
struct pm_statements_node *statements;
|
1827
|
+
struct pm_else_node *consequent;
|
1828
|
+
pm_location_t end_keyword_loc;
|
1829
|
+
} pm_unless_node_t;
|
1830
|
+
|
1831
|
+
// UntilNode
|
1832
|
+
//
|
1833
|
+
// Type: PM_UNTIL_NODE
|
1834
|
+
// Flags:
|
1835
|
+
// PM_LOOP_FLAGS_BEGIN_MODIFIER
|
1836
|
+
typedef struct pm_until_node {
|
1837
|
+
pm_node_t base;
|
1838
|
+
pm_location_t keyword_loc;
|
1839
|
+
pm_location_t closing_loc;
|
1840
|
+
struct pm_node *predicate;
|
1841
|
+
struct pm_statements_node *statements;
|
1842
|
+
} pm_until_node_t;
|
1843
|
+
|
1844
|
+
// WhenNode
|
1845
|
+
//
|
1846
|
+
// Type: PM_WHEN_NODE
|
1847
|
+
typedef struct pm_when_node {
|
1848
|
+
pm_node_t base;
|
1849
|
+
pm_location_t keyword_loc;
|
1850
|
+
struct pm_node_list conditions;
|
1851
|
+
struct pm_statements_node *statements;
|
1852
|
+
} pm_when_node_t;
|
1853
|
+
|
1854
|
+
// WhileNode
|
1855
|
+
//
|
1856
|
+
// Type: PM_WHILE_NODE
|
1857
|
+
// Flags:
|
1858
|
+
// PM_LOOP_FLAGS_BEGIN_MODIFIER
|
1859
|
+
typedef struct pm_while_node {
|
1860
|
+
pm_node_t base;
|
1861
|
+
pm_location_t keyword_loc;
|
1862
|
+
pm_location_t closing_loc;
|
1863
|
+
struct pm_node *predicate;
|
1864
|
+
struct pm_statements_node *statements;
|
1865
|
+
} pm_while_node_t;
|
1866
|
+
|
1867
|
+
// XStringNode
|
1868
|
+
//
|
1869
|
+
// Type: PM_X_STRING_NODE
|
1870
|
+
typedef struct pm_x_string_node {
|
1871
|
+
pm_node_t base;
|
1872
|
+
pm_location_t opening_loc;
|
1873
|
+
pm_location_t content_loc;
|
1874
|
+
pm_location_t closing_loc;
|
1875
|
+
pm_string_t unescaped;
|
1876
|
+
} pm_x_string_node_t;
|
1877
|
+
|
1878
|
+
// YieldNode
|
1879
|
+
//
|
1880
|
+
// Type: PM_YIELD_NODE
|
1881
|
+
typedef struct pm_yield_node {
|
1882
|
+
pm_node_t base;
|
1883
|
+
pm_location_t keyword_loc;
|
1884
|
+
pm_location_t lparen_loc;
|
1885
|
+
struct pm_arguments_node *arguments;
|
1886
|
+
pm_location_t rparen_loc;
|
1887
|
+
} pm_yield_node_t;
|
1888
|
+
|
1889
|
+
// CallNodeFlags
|
1890
|
+
typedef enum {
|
1891
|
+
PM_CALL_NODE_FLAGS_SAFE_NAVIGATION = 1 << 2,
|
1892
|
+
PM_CALL_NODE_FLAGS_VARIABLE_CALL = 1 << 3,
|
1893
|
+
} pm_call_node_flags_t;
|
1894
|
+
|
1895
|
+
// IntegerBaseFlags
|
1896
|
+
typedef enum {
|
1897
|
+
PM_INTEGER_BASE_FLAGS_BINARY = 1 << 2,
|
1898
|
+
PM_INTEGER_BASE_FLAGS_OCTAL = 1 << 3,
|
1899
|
+
PM_INTEGER_BASE_FLAGS_DECIMAL = 1 << 4,
|
1900
|
+
PM_INTEGER_BASE_FLAGS_HEXADECIMAL = 1 << 5,
|
1901
|
+
} pm_integer_base_flags_t;
|
1902
|
+
|
1903
|
+
// LoopFlags
|
1904
|
+
typedef enum {
|
1905
|
+
PM_LOOP_FLAGS_BEGIN_MODIFIER = 1 << 2,
|
1906
|
+
} pm_loop_flags_t;
|
1907
|
+
|
1908
|
+
// RangeFlags
|
1909
|
+
typedef enum {
|
1910
|
+
PM_RANGE_FLAGS_EXCLUDE_END = 1 << 2,
|
1911
|
+
} pm_range_flags_t;
|
1912
|
+
|
1913
|
+
// RegularExpressionFlags
|
1914
|
+
typedef enum {
|
1915
|
+
PM_REGULAR_EXPRESSION_FLAGS_IGNORE_CASE = 1 << 2,
|
1916
|
+
PM_REGULAR_EXPRESSION_FLAGS_EXTENDED = 1 << 3,
|
1917
|
+
PM_REGULAR_EXPRESSION_FLAGS_MULTI_LINE = 1 << 4,
|
1918
|
+
PM_REGULAR_EXPRESSION_FLAGS_EUC_JP = 1 << 5,
|
1919
|
+
PM_REGULAR_EXPRESSION_FLAGS_ASCII_8BIT = 1 << 6,
|
1920
|
+
PM_REGULAR_EXPRESSION_FLAGS_WINDOWS_31J = 1 << 7,
|
1921
|
+
PM_REGULAR_EXPRESSION_FLAGS_UTF_8 = 1 << 8,
|
1922
|
+
PM_REGULAR_EXPRESSION_FLAGS_ONCE = 1 << 9,
|
1923
|
+
} pm_regular_expression_flags_t;
|
1924
|
+
|
1925
|
+
// StringFlags
|
1926
|
+
typedef enum {
|
1927
|
+
PM_STRING_FLAGS_FROZEN = 1 << 2,
|
1928
|
+
} pm_string_flags_t;
|
1929
|
+
|
1930
|
+
#define PRISM_SERIALIZE_ONLY_SEMANTICS_FIELDS false
|
1931
|
+
|
1932
|
+
#endif // PRISM_AST_H
|