yarp 0.10.0 → 0.12.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 +4 -4
- data/CHANGELOG.md +50 -1
- data/CONTRIBUTING.md +7 -0
- data/config.yml +259 -49
- data/docs/configuration.md +0 -1
- data/docs/mapping.md +91 -91
- data/docs/serialization.md +23 -20
- data/ext/yarp/api_node.c +1268 -419
- data/ext/yarp/extension.c +9 -2
- data/ext/yarp/extension.h +2 -2
- data/include/yarp/ast.h +471 -318
- data/include/yarp/diagnostic.h +203 -1
- data/include/yarp/enc/yp_encoding.h +1 -1
- data/include/yarp/node.h +0 -4
- data/include/yarp/parser.h +44 -16
- data/include/yarp/util/yp_char.h +22 -6
- data/include/yarp/util/yp_constant_pool.h +11 -4
- data/include/yarp/version.h +2 -2
- data/lib/yarp/desugar_visitor.rb +19 -19
- data/lib/yarp/mutation_visitor.rb +50 -15
- data/lib/yarp/node.rb +6455 -443
- data/lib/yarp/parse_result/comments.rb +172 -0
- data/lib/yarp/parse_result/newlines.rb +60 -0
- data/lib/yarp/pattern.rb +239 -0
- data/lib/yarp/serialize.rb +173 -140
- data/lib/yarp.rb +151 -76
- data/src/diagnostic.c +259 -2
- data/src/enc/yp_unicode.c +5 -5
- data/src/node.c +984 -872
- data/src/prettyprint.c +461 -203
- data/src/serialize.c +380 -185
- data/src/unescape.c +20 -20
- data/src/util/yp_char.c +59 -16
- data/src/util/yp_constant_pool.c +97 -13
- data/src/util/yp_newline_list.c +5 -1
- data/src/util/yp_string_list.c +4 -1
- data/src/yarp.c +2313 -1675
- data/yarp.gemspec +4 -1
- metadata +5 -2
data/include/yarp/ast.h
CHANGED
@@ -199,12 +199,6 @@ typedef struct {
|
|
199
199
|
const uint8_t *end;
|
200
200
|
} yp_location_t;
|
201
201
|
|
202
|
-
typedef struct {
|
203
|
-
yp_location_t *locations;
|
204
|
-
size_t size;
|
205
|
-
size_t capacity;
|
206
|
-
} yp_location_list_t;
|
207
|
-
|
208
202
|
struct yp_node;
|
209
203
|
|
210
204
|
typedef struct yp_node_list {
|
@@ -214,141 +208,148 @@ typedef struct yp_node_list {
|
|
214
208
|
} yp_node_list_t;
|
215
209
|
|
216
210
|
enum yp_node_type {
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
211
|
+
YP_ALIAS_GLOBAL_VARIABLE_NODE = 1,
|
212
|
+
YP_ALIAS_METHOD_NODE = 2,
|
213
|
+
YP_ALTERNATION_PATTERN_NODE = 3,
|
214
|
+
YP_AND_NODE = 4,
|
215
|
+
YP_ARGUMENTS_NODE = 5,
|
216
|
+
YP_ARRAY_NODE = 6,
|
217
|
+
YP_ARRAY_PATTERN_NODE = 7,
|
218
|
+
YP_ASSOC_NODE = 8,
|
219
|
+
YP_ASSOC_SPLAT_NODE = 9,
|
220
|
+
YP_BACK_REFERENCE_READ_NODE = 10,
|
221
|
+
YP_BEGIN_NODE = 11,
|
222
|
+
YP_BLOCK_ARGUMENT_NODE = 12,
|
223
|
+
YP_BLOCK_LOCAL_VARIABLE_NODE = 13,
|
224
|
+
YP_BLOCK_NODE = 14,
|
225
|
+
YP_BLOCK_PARAMETER_NODE = 15,
|
226
|
+
YP_BLOCK_PARAMETERS_NODE = 16,
|
227
|
+
YP_BREAK_NODE = 17,
|
228
|
+
YP_CALL_AND_WRITE_NODE = 18,
|
229
|
+
YP_CALL_NODE = 19,
|
230
|
+
YP_CALL_OPERATOR_WRITE_NODE = 20,
|
231
|
+
YP_CALL_OR_WRITE_NODE = 21,
|
232
|
+
YP_CAPTURE_PATTERN_NODE = 22,
|
233
|
+
YP_CASE_NODE = 23,
|
234
|
+
YP_CLASS_NODE = 24,
|
235
|
+
YP_CLASS_VARIABLE_AND_WRITE_NODE = 25,
|
236
|
+
YP_CLASS_VARIABLE_OPERATOR_WRITE_NODE = 26,
|
237
|
+
YP_CLASS_VARIABLE_OR_WRITE_NODE = 27,
|
238
|
+
YP_CLASS_VARIABLE_READ_NODE = 28,
|
239
|
+
YP_CLASS_VARIABLE_TARGET_NODE = 29,
|
240
|
+
YP_CLASS_VARIABLE_WRITE_NODE = 30,
|
241
|
+
YP_CONSTANT_AND_WRITE_NODE = 31,
|
242
|
+
YP_CONSTANT_OPERATOR_WRITE_NODE = 32,
|
243
|
+
YP_CONSTANT_OR_WRITE_NODE = 33,
|
244
|
+
YP_CONSTANT_PATH_AND_WRITE_NODE = 34,
|
245
|
+
YP_CONSTANT_PATH_NODE = 35,
|
246
|
+
YP_CONSTANT_PATH_OPERATOR_WRITE_NODE = 36,
|
247
|
+
YP_CONSTANT_PATH_OR_WRITE_NODE = 37,
|
248
|
+
YP_CONSTANT_PATH_TARGET_NODE = 38,
|
249
|
+
YP_CONSTANT_PATH_WRITE_NODE = 39,
|
250
|
+
YP_CONSTANT_READ_NODE = 40,
|
251
|
+
YP_CONSTANT_TARGET_NODE = 41,
|
252
|
+
YP_CONSTANT_WRITE_NODE = 42,
|
253
|
+
YP_DEF_NODE = 43,
|
254
|
+
YP_DEFINED_NODE = 44,
|
255
|
+
YP_ELSE_NODE = 45,
|
256
|
+
YP_EMBEDDED_STATEMENTS_NODE = 46,
|
257
|
+
YP_EMBEDDED_VARIABLE_NODE = 47,
|
258
|
+
YP_ENSURE_NODE = 48,
|
259
|
+
YP_FALSE_NODE = 49,
|
260
|
+
YP_FIND_PATTERN_NODE = 50,
|
261
|
+
YP_FLIP_FLOP_NODE = 51,
|
262
|
+
YP_FLOAT_NODE = 52,
|
263
|
+
YP_FOR_NODE = 53,
|
264
|
+
YP_FORWARDING_ARGUMENTS_NODE = 54,
|
265
|
+
YP_FORWARDING_PARAMETER_NODE = 55,
|
266
|
+
YP_FORWARDING_SUPER_NODE = 56,
|
267
|
+
YP_GLOBAL_VARIABLE_AND_WRITE_NODE = 57,
|
268
|
+
YP_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE = 58,
|
269
|
+
YP_GLOBAL_VARIABLE_OR_WRITE_NODE = 59,
|
270
|
+
YP_GLOBAL_VARIABLE_READ_NODE = 60,
|
271
|
+
YP_GLOBAL_VARIABLE_TARGET_NODE = 61,
|
272
|
+
YP_GLOBAL_VARIABLE_WRITE_NODE = 62,
|
273
|
+
YP_HASH_NODE = 63,
|
274
|
+
YP_HASH_PATTERN_NODE = 64,
|
275
|
+
YP_IF_NODE = 65,
|
276
|
+
YP_IMAGINARY_NODE = 66,
|
277
|
+
YP_IMPLICIT_NODE = 67,
|
278
|
+
YP_IN_NODE = 68,
|
279
|
+
YP_INSTANCE_VARIABLE_AND_WRITE_NODE = 69,
|
280
|
+
YP_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE = 70,
|
281
|
+
YP_INSTANCE_VARIABLE_OR_WRITE_NODE = 71,
|
282
|
+
YP_INSTANCE_VARIABLE_READ_NODE = 72,
|
283
|
+
YP_INSTANCE_VARIABLE_TARGET_NODE = 73,
|
284
|
+
YP_INSTANCE_VARIABLE_WRITE_NODE = 74,
|
285
|
+
YP_INTEGER_NODE = 75,
|
286
|
+
YP_INTERPOLATED_MATCH_LAST_LINE_NODE = 76,
|
287
|
+
YP_INTERPOLATED_REGULAR_EXPRESSION_NODE = 77,
|
288
|
+
YP_INTERPOLATED_STRING_NODE = 78,
|
289
|
+
YP_INTERPOLATED_SYMBOL_NODE = 79,
|
290
|
+
YP_INTERPOLATED_X_STRING_NODE = 80,
|
291
|
+
YP_KEYWORD_HASH_NODE = 81,
|
292
|
+
YP_KEYWORD_PARAMETER_NODE = 82,
|
293
|
+
YP_KEYWORD_REST_PARAMETER_NODE = 83,
|
294
|
+
YP_LAMBDA_NODE = 84,
|
295
|
+
YP_LOCAL_VARIABLE_AND_WRITE_NODE = 85,
|
296
|
+
YP_LOCAL_VARIABLE_OPERATOR_WRITE_NODE = 86,
|
297
|
+
YP_LOCAL_VARIABLE_OR_WRITE_NODE = 87,
|
298
|
+
YP_LOCAL_VARIABLE_READ_NODE = 88,
|
299
|
+
YP_LOCAL_VARIABLE_TARGET_NODE = 89,
|
300
|
+
YP_LOCAL_VARIABLE_WRITE_NODE = 90,
|
301
|
+
YP_MATCH_LAST_LINE_NODE = 91,
|
302
|
+
YP_MATCH_PREDICATE_NODE = 92,
|
303
|
+
YP_MATCH_REQUIRED_NODE = 93,
|
304
|
+
YP_MATCH_WRITE_NODE = 94,
|
305
|
+
YP_MISSING_NODE = 95,
|
306
|
+
YP_MODULE_NODE = 96,
|
307
|
+
YP_MULTI_TARGET_NODE = 97,
|
308
|
+
YP_MULTI_WRITE_NODE = 98,
|
309
|
+
YP_NEXT_NODE = 99,
|
310
|
+
YP_NIL_NODE = 100,
|
311
|
+
YP_NO_KEYWORDS_PARAMETER_NODE = 101,
|
312
|
+
YP_NUMBERED_REFERENCE_READ_NODE = 102,
|
313
|
+
YP_OPTIONAL_PARAMETER_NODE = 103,
|
314
|
+
YP_OR_NODE = 104,
|
315
|
+
YP_PARAMETERS_NODE = 105,
|
316
|
+
YP_PARENTHESES_NODE = 106,
|
317
|
+
YP_PINNED_EXPRESSION_NODE = 107,
|
318
|
+
YP_PINNED_VARIABLE_NODE = 108,
|
319
|
+
YP_POST_EXECUTION_NODE = 109,
|
320
|
+
YP_PRE_EXECUTION_NODE = 110,
|
321
|
+
YP_PROGRAM_NODE = 111,
|
322
|
+
YP_RANGE_NODE = 112,
|
323
|
+
YP_RATIONAL_NODE = 113,
|
324
|
+
YP_REDO_NODE = 114,
|
325
|
+
YP_REGULAR_EXPRESSION_NODE = 115,
|
326
|
+
YP_REQUIRED_DESTRUCTURED_PARAMETER_NODE = 116,
|
327
|
+
YP_REQUIRED_PARAMETER_NODE = 117,
|
328
|
+
YP_RESCUE_MODIFIER_NODE = 118,
|
329
|
+
YP_RESCUE_NODE = 119,
|
330
|
+
YP_REST_PARAMETER_NODE = 120,
|
331
|
+
YP_RETRY_NODE = 121,
|
332
|
+
YP_RETURN_NODE = 122,
|
333
|
+
YP_SELF_NODE = 123,
|
334
|
+
YP_SINGLETON_CLASS_NODE = 124,
|
335
|
+
YP_SOURCE_ENCODING_NODE = 125,
|
336
|
+
YP_SOURCE_FILE_NODE = 126,
|
337
|
+
YP_SOURCE_LINE_NODE = 127,
|
338
|
+
YP_SPLAT_NODE = 128,
|
339
|
+
YP_STATEMENTS_NODE = 129,
|
340
|
+
YP_STRING_CONCAT_NODE = 130,
|
341
|
+
YP_STRING_NODE = 131,
|
342
|
+
YP_SUPER_NODE = 132,
|
343
|
+
YP_SYMBOL_NODE = 133,
|
344
|
+
YP_TRUE_NODE = 134,
|
345
|
+
YP_UNDEF_NODE = 135,
|
346
|
+
YP_UNLESS_NODE = 136,
|
347
|
+
YP_UNTIL_NODE = 137,
|
348
|
+
YP_WHEN_NODE = 138,
|
349
|
+
YP_WHILE_NODE = 139,
|
350
|
+
YP_X_STRING_NODE = 140,
|
351
|
+
YP_YIELD_NODE = 141,
|
352
|
+
YP_SCOPE_NODE
|
352
353
|
};
|
353
354
|
|
354
355
|
typedef uint16_t yp_node_type_t;
|
@@ -357,6 +358,7 @@ typedef uint16_t yp_node_flags_t;
|
|
357
358
|
// We store the flags enum in every node in the tree. Some flags are common to
|
358
359
|
// all nodes (the ones listed below). Others are specific to certain node types.
|
359
360
|
static const yp_node_flags_t YP_NODE_FLAG_NEWLINE = 0x1;
|
361
|
+
static const yp_node_flags_t YP_NODE_FLAG_STATIC_LITERAL = 0x2;
|
360
362
|
|
361
363
|
// For easy access, we define some macros to check node type
|
362
364
|
#define YP_NODE_TYPE(node) ((enum yp_node_type)node->type)
|
@@ -376,19 +378,29 @@ typedef struct yp_node {
|
|
376
378
|
yp_location_t location;
|
377
379
|
} yp_node_t;
|
378
380
|
|
379
|
-
//
|
381
|
+
// AliasGlobalVariableNode
|
382
|
+
//
|
383
|
+
// Type: YP_ALIAS_GLOBAL_VARIABLE_NODE
|
384
|
+
typedef struct yp_alias_global_variable_node {
|
385
|
+
yp_node_t base;
|
386
|
+
struct yp_node *new_name;
|
387
|
+
struct yp_node *old_name;
|
388
|
+
yp_location_t keyword_loc;
|
389
|
+
} yp_alias_global_variable_node_t;
|
390
|
+
|
391
|
+
// AliasMethodNode
|
380
392
|
//
|
381
|
-
// Type:
|
382
|
-
typedef struct
|
393
|
+
// Type: YP_ALIAS_METHOD_NODE
|
394
|
+
typedef struct yp_alias_method_node {
|
383
395
|
yp_node_t base;
|
384
396
|
struct yp_node *new_name;
|
385
397
|
struct yp_node *old_name;
|
386
398
|
yp_location_t keyword_loc;
|
387
|
-
}
|
399
|
+
} yp_alias_method_node_t;
|
388
400
|
|
389
401
|
// AlternationPatternNode
|
390
402
|
//
|
391
|
-
// Type:
|
403
|
+
// Type: YP_ALTERNATION_PATTERN_NODE
|
392
404
|
typedef struct yp_alternation_pattern_node {
|
393
405
|
yp_node_t base;
|
394
406
|
struct yp_node *left;
|
@@ -398,7 +410,7 @@ typedef struct yp_alternation_pattern_node {
|
|
398
410
|
|
399
411
|
// AndNode
|
400
412
|
//
|
401
|
-
// Type:
|
413
|
+
// Type: YP_AND_NODE
|
402
414
|
typedef struct yp_and_node {
|
403
415
|
yp_node_t base;
|
404
416
|
struct yp_node *left;
|
@@ -408,7 +420,7 @@ typedef struct yp_and_node {
|
|
408
420
|
|
409
421
|
// ArgumentsNode
|
410
422
|
//
|
411
|
-
// Type:
|
423
|
+
// Type: YP_ARGUMENTS_NODE
|
412
424
|
typedef struct yp_arguments_node {
|
413
425
|
yp_node_t base;
|
414
426
|
struct yp_node_list arguments;
|
@@ -416,7 +428,7 @@ typedef struct yp_arguments_node {
|
|
416
428
|
|
417
429
|
// ArrayNode
|
418
430
|
//
|
419
|
-
// Type:
|
431
|
+
// Type: YP_ARRAY_NODE
|
420
432
|
typedef struct yp_array_node {
|
421
433
|
yp_node_t base;
|
422
434
|
struct yp_node_list elements;
|
@@ -426,7 +438,7 @@ typedef struct yp_array_node {
|
|
426
438
|
|
427
439
|
// ArrayPatternNode
|
428
440
|
//
|
429
|
-
// Type:
|
441
|
+
// Type: YP_ARRAY_PATTERN_NODE
|
430
442
|
typedef struct yp_array_pattern_node {
|
431
443
|
yp_node_t base;
|
432
444
|
struct yp_node *constant;
|
@@ -439,7 +451,7 @@ typedef struct yp_array_pattern_node {
|
|
439
451
|
|
440
452
|
// AssocNode
|
441
453
|
//
|
442
|
-
// Type:
|
454
|
+
// Type: YP_ASSOC_NODE
|
443
455
|
typedef struct yp_assoc_node {
|
444
456
|
yp_node_t base;
|
445
457
|
struct yp_node *key;
|
@@ -449,7 +461,7 @@ typedef struct yp_assoc_node {
|
|
449
461
|
|
450
462
|
// AssocSplatNode
|
451
463
|
//
|
452
|
-
// Type:
|
464
|
+
// Type: YP_ASSOC_SPLAT_NODE
|
453
465
|
typedef struct yp_assoc_splat_node {
|
454
466
|
yp_node_t base;
|
455
467
|
struct yp_node *value;
|
@@ -458,14 +470,14 @@ typedef struct yp_assoc_splat_node {
|
|
458
470
|
|
459
471
|
// BackReferenceReadNode
|
460
472
|
//
|
461
|
-
// Type:
|
473
|
+
// Type: YP_BACK_REFERENCE_READ_NODE
|
462
474
|
typedef struct yp_back_reference_read_node {
|
463
475
|
yp_node_t base;
|
464
476
|
} yp_back_reference_read_node_t;
|
465
477
|
|
466
478
|
// BeginNode
|
467
479
|
//
|
468
|
-
// Type:
|
480
|
+
// Type: YP_BEGIN_NODE
|
469
481
|
typedef struct yp_begin_node {
|
470
482
|
yp_node_t base;
|
471
483
|
yp_location_t begin_keyword_loc;
|
@@ -478,16 +490,24 @@ typedef struct yp_begin_node {
|
|
478
490
|
|
479
491
|
// BlockArgumentNode
|
480
492
|
//
|
481
|
-
// Type:
|
493
|
+
// Type: YP_BLOCK_ARGUMENT_NODE
|
482
494
|
typedef struct yp_block_argument_node {
|
483
495
|
yp_node_t base;
|
484
496
|
struct yp_node *expression;
|
485
497
|
yp_location_t operator_loc;
|
486
498
|
} yp_block_argument_node_t;
|
487
499
|
|
500
|
+
// BlockLocalVariableNode
|
501
|
+
//
|
502
|
+
// Type: YP_BLOCK_LOCAL_VARIABLE_NODE
|
503
|
+
typedef struct yp_block_local_variable_node {
|
504
|
+
yp_node_t base;
|
505
|
+
yp_constant_id_t name;
|
506
|
+
} yp_block_local_variable_node_t;
|
507
|
+
|
488
508
|
// BlockNode
|
489
509
|
//
|
490
|
-
// Type:
|
510
|
+
// Type: YP_BLOCK_NODE
|
491
511
|
typedef struct yp_block_node {
|
492
512
|
yp_node_t base;
|
493
513
|
yp_constant_id_list_t locals;
|
@@ -499,43 +519,64 @@ typedef struct yp_block_node {
|
|
499
519
|
|
500
520
|
// BlockParameterNode
|
501
521
|
//
|
502
|
-
// Type:
|
522
|
+
// Type: YP_BLOCK_PARAMETER_NODE
|
503
523
|
typedef struct yp_block_parameter_node {
|
504
524
|
yp_node_t base;
|
525
|
+
yp_constant_id_t name;
|
505
526
|
yp_location_t name_loc;
|
506
527
|
yp_location_t operator_loc;
|
507
528
|
} yp_block_parameter_node_t;
|
508
529
|
|
509
530
|
// BlockParametersNode
|
510
531
|
//
|
511
|
-
// Type:
|
532
|
+
// Type: YP_BLOCK_PARAMETERS_NODE
|
512
533
|
typedef struct yp_block_parameters_node {
|
513
534
|
yp_node_t base;
|
514
535
|
struct yp_parameters_node *parameters;
|
515
|
-
|
536
|
+
struct yp_node_list locals;
|
516
537
|
yp_location_t opening_loc;
|
517
538
|
yp_location_t closing_loc;
|
518
539
|
} yp_block_parameters_node_t;
|
519
540
|
|
520
541
|
// BreakNode
|
521
542
|
//
|
522
|
-
// Type:
|
543
|
+
// Type: YP_BREAK_NODE
|
523
544
|
typedef struct yp_break_node {
|
524
545
|
yp_node_t base;
|
525
546
|
struct yp_arguments_node *arguments;
|
526
547
|
yp_location_t keyword_loc;
|
527
548
|
} yp_break_node_t;
|
528
549
|
|
550
|
+
// CallAndWriteNode
|
551
|
+
//
|
552
|
+
// Type: YP_CALL_AND_WRITE_NODE
|
553
|
+
// Flags:
|
554
|
+
// YP_CALL_NODE_FLAGS_SAFE_NAVIGATION
|
555
|
+
// YP_CALL_NODE_FLAGS_VARIABLE_CALL
|
556
|
+
typedef struct yp_call_and_write_node {
|
557
|
+
yp_node_t base;
|
558
|
+
struct yp_node *receiver;
|
559
|
+
yp_location_t call_operator_loc;
|
560
|
+
yp_location_t message_loc;
|
561
|
+
yp_location_t opening_loc;
|
562
|
+
struct yp_arguments_node *arguments;
|
563
|
+
yp_location_t closing_loc;
|
564
|
+
yp_string_t read_name;
|
565
|
+
yp_string_t write_name;
|
566
|
+
yp_location_t operator_loc;
|
567
|
+
struct yp_node *value;
|
568
|
+
} yp_call_and_write_node_t;
|
569
|
+
|
529
570
|
// CallNode
|
530
571
|
//
|
531
|
-
// Type:
|
572
|
+
// Type: YP_CALL_NODE
|
532
573
|
// Flags:
|
533
574
|
// YP_CALL_NODE_FLAGS_SAFE_NAVIGATION
|
534
575
|
// YP_CALL_NODE_FLAGS_VARIABLE_CALL
|
535
576
|
typedef struct yp_call_node {
|
536
577
|
yp_node_t base;
|
537
578
|
struct yp_node *receiver;
|
538
|
-
yp_location_t
|
579
|
+
yp_location_t call_operator_loc;
|
539
580
|
yp_location_t message_loc;
|
540
581
|
yp_location_t opening_loc;
|
541
582
|
struct yp_arguments_node *arguments;
|
@@ -544,40 +585,50 @@ typedef struct yp_call_node {
|
|
544
585
|
yp_string_t name;
|
545
586
|
} yp_call_node_t;
|
546
587
|
|
547
|
-
//
|
588
|
+
// CallOperatorWriteNode
|
548
589
|
//
|
549
|
-
// Type:
|
550
|
-
|
590
|
+
// Type: YP_CALL_OPERATOR_WRITE_NODE
|
591
|
+
// Flags:
|
592
|
+
// YP_CALL_NODE_FLAGS_SAFE_NAVIGATION
|
593
|
+
// YP_CALL_NODE_FLAGS_VARIABLE_CALL
|
594
|
+
typedef struct yp_call_operator_write_node {
|
551
595
|
yp_node_t base;
|
552
|
-
struct
|
596
|
+
struct yp_node *receiver;
|
597
|
+
yp_location_t call_operator_loc;
|
598
|
+
yp_location_t message_loc;
|
599
|
+
yp_location_t opening_loc;
|
600
|
+
struct yp_arguments_node *arguments;
|
601
|
+
yp_location_t closing_loc;
|
602
|
+
yp_string_t read_name;
|
603
|
+
yp_string_t write_name;
|
604
|
+
yp_constant_id_t operator;
|
553
605
|
yp_location_t operator_loc;
|
554
606
|
struct yp_node *value;
|
555
|
-
}
|
556
|
-
|
557
|
-
// CallOperatorOrWriteNode
|
558
|
-
//
|
559
|
-
// Type: YP_NODE_CALL_OPERATOR_OR_WRITE_NODE
|
560
|
-
typedef struct yp_call_operator_or_write_node {
|
561
|
-
yp_node_t base;
|
562
|
-
struct yp_call_node *target;
|
563
|
-
struct yp_node *value;
|
564
|
-
yp_location_t operator_loc;
|
565
|
-
} yp_call_operator_or_write_node_t;
|
607
|
+
} yp_call_operator_write_node_t;
|
566
608
|
|
567
|
-
//
|
609
|
+
// CallOrWriteNode
|
568
610
|
//
|
569
|
-
// Type:
|
570
|
-
|
611
|
+
// Type: YP_CALL_OR_WRITE_NODE
|
612
|
+
// Flags:
|
613
|
+
// YP_CALL_NODE_FLAGS_SAFE_NAVIGATION
|
614
|
+
// YP_CALL_NODE_FLAGS_VARIABLE_CALL
|
615
|
+
typedef struct yp_call_or_write_node {
|
571
616
|
yp_node_t base;
|
572
|
-
struct
|
617
|
+
struct yp_node *receiver;
|
618
|
+
yp_location_t call_operator_loc;
|
619
|
+
yp_location_t message_loc;
|
620
|
+
yp_location_t opening_loc;
|
621
|
+
struct yp_arguments_node *arguments;
|
622
|
+
yp_location_t closing_loc;
|
623
|
+
yp_string_t read_name;
|
624
|
+
yp_string_t write_name;
|
573
625
|
yp_location_t operator_loc;
|
574
626
|
struct yp_node *value;
|
575
|
-
|
576
|
-
} yp_call_operator_write_node_t;
|
627
|
+
} yp_call_or_write_node_t;
|
577
628
|
|
578
629
|
// CapturePatternNode
|
579
630
|
//
|
580
|
-
// Type:
|
631
|
+
// Type: YP_CAPTURE_PATTERN_NODE
|
581
632
|
typedef struct yp_capture_pattern_node {
|
582
633
|
yp_node_t base;
|
583
634
|
struct yp_node *value;
|
@@ -587,7 +638,7 @@ typedef struct yp_capture_pattern_node {
|
|
587
638
|
|
588
639
|
// CaseNode
|
589
640
|
//
|
590
|
-
// Type:
|
641
|
+
// Type: YP_CASE_NODE
|
591
642
|
typedef struct yp_case_node {
|
592
643
|
yp_node_t base;
|
593
644
|
struct yp_node *predicate;
|
@@ -599,7 +650,7 @@ typedef struct yp_case_node {
|
|
599
650
|
|
600
651
|
// ClassNode
|
601
652
|
//
|
602
|
-
// Type:
|
653
|
+
// Type: YP_CLASS_NODE
|
603
654
|
typedef struct yp_class_node {
|
604
655
|
yp_node_t base;
|
605
656
|
yp_constant_id_list_t locals;
|
@@ -609,12 +660,12 @@ typedef struct yp_class_node {
|
|
609
660
|
struct yp_node *superclass;
|
610
661
|
struct yp_node *body;
|
611
662
|
yp_location_t end_keyword_loc;
|
612
|
-
|
663
|
+
yp_constant_id_t name;
|
613
664
|
} yp_class_node_t;
|
614
665
|
|
615
666
|
// ClassVariableAndWriteNode
|
616
667
|
//
|
617
|
-
// Type:
|
668
|
+
// Type: YP_CLASS_VARIABLE_AND_WRITE_NODE
|
618
669
|
typedef struct yp_class_variable_and_write_node {
|
619
670
|
yp_node_t base;
|
620
671
|
yp_constant_id_t name;
|
@@ -625,7 +676,7 @@ typedef struct yp_class_variable_and_write_node {
|
|
625
676
|
|
626
677
|
// ClassVariableOperatorWriteNode
|
627
678
|
//
|
628
|
-
// Type:
|
679
|
+
// Type: YP_CLASS_VARIABLE_OPERATOR_WRITE_NODE
|
629
680
|
typedef struct yp_class_variable_operator_write_node {
|
630
681
|
yp_node_t base;
|
631
682
|
yp_constant_id_t name;
|
@@ -637,7 +688,7 @@ typedef struct yp_class_variable_operator_write_node {
|
|
637
688
|
|
638
689
|
// ClassVariableOrWriteNode
|
639
690
|
//
|
640
|
-
// Type:
|
691
|
+
// Type: YP_CLASS_VARIABLE_OR_WRITE_NODE
|
641
692
|
typedef struct yp_class_variable_or_write_node {
|
642
693
|
yp_node_t base;
|
643
694
|
yp_constant_id_t name;
|
@@ -648,7 +699,7 @@ typedef struct yp_class_variable_or_write_node {
|
|
648
699
|
|
649
700
|
// ClassVariableReadNode
|
650
701
|
//
|
651
|
-
// Type:
|
702
|
+
// Type: YP_CLASS_VARIABLE_READ_NODE
|
652
703
|
typedef struct yp_class_variable_read_node {
|
653
704
|
yp_node_t base;
|
654
705
|
yp_constant_id_t name;
|
@@ -656,7 +707,7 @@ typedef struct yp_class_variable_read_node {
|
|
656
707
|
|
657
708
|
// ClassVariableTargetNode
|
658
709
|
//
|
659
|
-
// Type:
|
710
|
+
// Type: YP_CLASS_VARIABLE_TARGET_NODE
|
660
711
|
typedef struct yp_class_variable_target_node {
|
661
712
|
yp_node_t base;
|
662
713
|
yp_constant_id_t name;
|
@@ -664,7 +715,7 @@ typedef struct yp_class_variable_target_node {
|
|
664
715
|
|
665
716
|
// ClassVariableWriteNode
|
666
717
|
//
|
667
|
-
// Type:
|
718
|
+
// Type: YP_CLASS_VARIABLE_WRITE_NODE
|
668
719
|
typedef struct yp_class_variable_write_node {
|
669
720
|
yp_node_t base;
|
670
721
|
yp_constant_id_t name;
|
@@ -675,9 +726,10 @@ typedef struct yp_class_variable_write_node {
|
|
675
726
|
|
676
727
|
// ConstantAndWriteNode
|
677
728
|
//
|
678
|
-
// Type:
|
729
|
+
// Type: YP_CONSTANT_AND_WRITE_NODE
|
679
730
|
typedef struct yp_constant_and_write_node {
|
680
731
|
yp_node_t base;
|
732
|
+
yp_constant_id_t name;
|
681
733
|
yp_location_t name_loc;
|
682
734
|
yp_location_t operator_loc;
|
683
735
|
struct yp_node *value;
|
@@ -685,9 +737,10 @@ typedef struct yp_constant_and_write_node {
|
|
685
737
|
|
686
738
|
// ConstantOperatorWriteNode
|
687
739
|
//
|
688
|
-
// Type:
|
740
|
+
// Type: YP_CONSTANT_OPERATOR_WRITE_NODE
|
689
741
|
typedef struct yp_constant_operator_write_node {
|
690
742
|
yp_node_t base;
|
743
|
+
yp_constant_id_t name;
|
691
744
|
yp_location_t name_loc;
|
692
745
|
yp_location_t operator_loc;
|
693
746
|
struct yp_node *value;
|
@@ -696,9 +749,10 @@ typedef struct yp_constant_operator_write_node {
|
|
696
749
|
|
697
750
|
// ConstantOrWriteNode
|
698
751
|
//
|
699
|
-
// Type:
|
752
|
+
// Type: YP_CONSTANT_OR_WRITE_NODE
|
700
753
|
typedef struct yp_constant_or_write_node {
|
701
754
|
yp_node_t base;
|
755
|
+
yp_constant_id_t name;
|
702
756
|
yp_location_t name_loc;
|
703
757
|
yp_location_t operator_loc;
|
704
758
|
struct yp_node *value;
|
@@ -706,7 +760,7 @@ typedef struct yp_constant_or_write_node {
|
|
706
760
|
|
707
761
|
// ConstantPathAndWriteNode
|
708
762
|
//
|
709
|
-
// Type:
|
763
|
+
// Type: YP_CONSTANT_PATH_AND_WRITE_NODE
|
710
764
|
typedef struct yp_constant_path_and_write_node {
|
711
765
|
yp_node_t base;
|
712
766
|
struct yp_constant_path_node *target;
|
@@ -716,7 +770,7 @@ typedef struct yp_constant_path_and_write_node {
|
|
716
770
|
|
717
771
|
// ConstantPathNode
|
718
772
|
//
|
719
|
-
// Type:
|
773
|
+
// Type: YP_CONSTANT_PATH_NODE
|
720
774
|
typedef struct yp_constant_path_node {
|
721
775
|
yp_node_t base;
|
722
776
|
struct yp_node *parent;
|
@@ -726,7 +780,7 @@ typedef struct yp_constant_path_node {
|
|
726
780
|
|
727
781
|
// ConstantPathOperatorWriteNode
|
728
782
|
//
|
729
|
-
// Type:
|
783
|
+
// Type: YP_CONSTANT_PATH_OPERATOR_WRITE_NODE
|
730
784
|
typedef struct yp_constant_path_operator_write_node {
|
731
785
|
yp_node_t base;
|
732
786
|
struct yp_constant_path_node *target;
|
@@ -737,7 +791,7 @@ typedef struct yp_constant_path_operator_write_node {
|
|
737
791
|
|
738
792
|
// ConstantPathOrWriteNode
|
739
793
|
//
|
740
|
-
// Type:
|
794
|
+
// Type: YP_CONSTANT_PATH_OR_WRITE_NODE
|
741
795
|
typedef struct yp_constant_path_or_write_node {
|
742
796
|
yp_node_t base;
|
743
797
|
struct yp_constant_path_node *target;
|
@@ -747,7 +801,7 @@ typedef struct yp_constant_path_or_write_node {
|
|
747
801
|
|
748
802
|
// ConstantPathTargetNode
|
749
803
|
//
|
750
|
-
// Type:
|
804
|
+
// Type: YP_CONSTANT_PATH_TARGET_NODE
|
751
805
|
typedef struct yp_constant_path_target_node {
|
752
806
|
yp_node_t base;
|
753
807
|
struct yp_node *parent;
|
@@ -757,7 +811,7 @@ typedef struct yp_constant_path_target_node {
|
|
757
811
|
|
758
812
|
// ConstantPathWriteNode
|
759
813
|
//
|
760
|
-
// Type:
|
814
|
+
// Type: YP_CONSTANT_PATH_WRITE_NODE
|
761
815
|
typedef struct yp_constant_path_write_node {
|
762
816
|
yp_node_t base;
|
763
817
|
struct yp_constant_path_node *target;
|
@@ -767,23 +821,26 @@ typedef struct yp_constant_path_write_node {
|
|
767
821
|
|
768
822
|
// ConstantReadNode
|
769
823
|
//
|
770
|
-
// Type:
|
824
|
+
// Type: YP_CONSTANT_READ_NODE
|
771
825
|
typedef struct yp_constant_read_node {
|
772
826
|
yp_node_t base;
|
827
|
+
yp_constant_id_t name;
|
773
828
|
} yp_constant_read_node_t;
|
774
829
|
|
775
830
|
// ConstantTargetNode
|
776
831
|
//
|
777
|
-
// Type:
|
832
|
+
// Type: YP_CONSTANT_TARGET_NODE
|
778
833
|
typedef struct yp_constant_target_node {
|
779
834
|
yp_node_t base;
|
835
|
+
yp_constant_id_t name;
|
780
836
|
} yp_constant_target_node_t;
|
781
837
|
|
782
838
|
// ConstantWriteNode
|
783
839
|
//
|
784
|
-
// Type:
|
840
|
+
// Type: YP_CONSTANT_WRITE_NODE
|
785
841
|
typedef struct yp_constant_write_node {
|
786
842
|
yp_node_t base;
|
843
|
+
yp_constant_id_t name;
|
787
844
|
yp_location_t name_loc;
|
788
845
|
struct yp_node *value;
|
789
846
|
yp_location_t operator_loc;
|
@@ -791,9 +848,10 @@ typedef struct yp_constant_write_node {
|
|
791
848
|
|
792
849
|
// DefNode
|
793
850
|
//
|
794
|
-
// Type:
|
851
|
+
// Type: YP_DEF_NODE
|
795
852
|
typedef struct yp_def_node {
|
796
853
|
yp_node_t base;
|
854
|
+
yp_constant_id_t name;
|
797
855
|
yp_location_t name_loc;
|
798
856
|
struct yp_node *receiver;
|
799
857
|
struct yp_parameters_node *parameters;
|
@@ -809,7 +867,7 @@ typedef struct yp_def_node {
|
|
809
867
|
|
810
868
|
// DefinedNode
|
811
869
|
//
|
812
|
-
// Type:
|
870
|
+
// Type: YP_DEFINED_NODE
|
813
871
|
typedef struct yp_defined_node {
|
814
872
|
yp_node_t base;
|
815
873
|
yp_location_t lparen_loc;
|
@@ -820,7 +878,7 @@ typedef struct yp_defined_node {
|
|
820
878
|
|
821
879
|
// ElseNode
|
822
880
|
//
|
823
|
-
// Type:
|
881
|
+
// Type: YP_ELSE_NODE
|
824
882
|
typedef struct yp_else_node {
|
825
883
|
yp_node_t base;
|
826
884
|
yp_location_t else_keyword_loc;
|
@@ -830,7 +888,7 @@ typedef struct yp_else_node {
|
|
830
888
|
|
831
889
|
// EmbeddedStatementsNode
|
832
890
|
//
|
833
|
-
// Type:
|
891
|
+
// Type: YP_EMBEDDED_STATEMENTS_NODE
|
834
892
|
typedef struct yp_embedded_statements_node {
|
835
893
|
yp_node_t base;
|
836
894
|
yp_location_t opening_loc;
|
@@ -840,7 +898,7 @@ typedef struct yp_embedded_statements_node {
|
|
840
898
|
|
841
899
|
// EmbeddedVariableNode
|
842
900
|
//
|
843
|
-
// Type:
|
901
|
+
// Type: YP_EMBEDDED_VARIABLE_NODE
|
844
902
|
typedef struct yp_embedded_variable_node {
|
845
903
|
yp_node_t base;
|
846
904
|
yp_location_t operator_loc;
|
@@ -849,7 +907,7 @@ typedef struct yp_embedded_variable_node {
|
|
849
907
|
|
850
908
|
// EnsureNode
|
851
909
|
//
|
852
|
-
// Type:
|
910
|
+
// Type: YP_ENSURE_NODE
|
853
911
|
typedef struct yp_ensure_node {
|
854
912
|
yp_node_t base;
|
855
913
|
yp_location_t ensure_keyword_loc;
|
@@ -859,14 +917,14 @@ typedef struct yp_ensure_node {
|
|
859
917
|
|
860
918
|
// FalseNode
|
861
919
|
//
|
862
|
-
// Type:
|
920
|
+
// Type: YP_FALSE_NODE
|
863
921
|
typedef struct yp_false_node {
|
864
922
|
yp_node_t base;
|
865
923
|
} yp_false_node_t;
|
866
924
|
|
867
925
|
// FindPatternNode
|
868
926
|
//
|
869
|
-
// Type:
|
927
|
+
// Type: YP_FIND_PATTERN_NODE
|
870
928
|
typedef struct yp_find_pattern_node {
|
871
929
|
yp_node_t base;
|
872
930
|
struct yp_node *constant;
|
@@ -879,7 +937,7 @@ typedef struct yp_find_pattern_node {
|
|
879
937
|
|
880
938
|
// FlipFlopNode
|
881
939
|
//
|
882
|
-
// Type:
|
940
|
+
// Type: YP_FLIP_FLOP_NODE
|
883
941
|
// Flags:
|
884
942
|
// YP_RANGE_FLAGS_EXCLUDE_END
|
885
943
|
typedef struct yp_flip_flop_node {
|
@@ -891,14 +949,14 @@ typedef struct yp_flip_flop_node {
|
|
891
949
|
|
892
950
|
// FloatNode
|
893
951
|
//
|
894
|
-
// Type:
|
952
|
+
// Type: YP_FLOAT_NODE
|
895
953
|
typedef struct yp_float_node {
|
896
954
|
yp_node_t base;
|
897
955
|
} yp_float_node_t;
|
898
956
|
|
899
957
|
// ForNode
|
900
958
|
//
|
901
|
-
// Type:
|
959
|
+
// Type: YP_FOR_NODE
|
902
960
|
typedef struct yp_for_node {
|
903
961
|
yp_node_t base;
|
904
962
|
struct yp_node *index;
|
@@ -912,21 +970,21 @@ typedef struct yp_for_node {
|
|
912
970
|
|
913
971
|
// ForwardingArgumentsNode
|
914
972
|
//
|
915
|
-
// Type:
|
973
|
+
// Type: YP_FORWARDING_ARGUMENTS_NODE
|
916
974
|
typedef struct yp_forwarding_arguments_node {
|
917
975
|
yp_node_t base;
|
918
976
|
} yp_forwarding_arguments_node_t;
|
919
977
|
|
920
978
|
// ForwardingParameterNode
|
921
979
|
//
|
922
|
-
// Type:
|
980
|
+
// Type: YP_FORWARDING_PARAMETER_NODE
|
923
981
|
typedef struct yp_forwarding_parameter_node {
|
924
982
|
yp_node_t base;
|
925
983
|
} yp_forwarding_parameter_node_t;
|
926
984
|
|
927
985
|
// ForwardingSuperNode
|
928
986
|
//
|
929
|
-
// Type:
|
987
|
+
// Type: YP_FORWARDING_SUPER_NODE
|
930
988
|
typedef struct yp_forwarding_super_node {
|
931
989
|
yp_node_t base;
|
932
990
|
struct yp_block_node *block;
|
@@ -934,9 +992,10 @@ typedef struct yp_forwarding_super_node {
|
|
934
992
|
|
935
993
|
// GlobalVariableAndWriteNode
|
936
994
|
//
|
937
|
-
// Type:
|
995
|
+
// Type: YP_GLOBAL_VARIABLE_AND_WRITE_NODE
|
938
996
|
typedef struct yp_global_variable_and_write_node {
|
939
997
|
yp_node_t base;
|
998
|
+
yp_constant_id_t name;
|
940
999
|
yp_location_t name_loc;
|
941
1000
|
yp_location_t operator_loc;
|
942
1001
|
struct yp_node *value;
|
@@ -944,9 +1003,10 @@ typedef struct yp_global_variable_and_write_node {
|
|
944
1003
|
|
945
1004
|
// GlobalVariableOperatorWriteNode
|
946
1005
|
//
|
947
|
-
// Type:
|
1006
|
+
// Type: YP_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE
|
948
1007
|
typedef struct yp_global_variable_operator_write_node {
|
949
1008
|
yp_node_t base;
|
1009
|
+
yp_constant_id_t name;
|
950
1010
|
yp_location_t name_loc;
|
951
1011
|
yp_location_t operator_loc;
|
952
1012
|
struct yp_node *value;
|
@@ -955,9 +1015,10 @@ typedef struct yp_global_variable_operator_write_node {
|
|
955
1015
|
|
956
1016
|
// GlobalVariableOrWriteNode
|
957
1017
|
//
|
958
|
-
// Type:
|
1018
|
+
// Type: YP_GLOBAL_VARIABLE_OR_WRITE_NODE
|
959
1019
|
typedef struct yp_global_variable_or_write_node {
|
960
1020
|
yp_node_t base;
|
1021
|
+
yp_constant_id_t name;
|
961
1022
|
yp_location_t name_loc;
|
962
1023
|
yp_location_t operator_loc;
|
963
1024
|
struct yp_node *value;
|
@@ -965,23 +1026,26 @@ typedef struct yp_global_variable_or_write_node {
|
|
965
1026
|
|
966
1027
|
// GlobalVariableReadNode
|
967
1028
|
//
|
968
|
-
// Type:
|
1029
|
+
// Type: YP_GLOBAL_VARIABLE_READ_NODE
|
969
1030
|
typedef struct yp_global_variable_read_node {
|
970
1031
|
yp_node_t base;
|
1032
|
+
yp_constant_id_t name;
|
971
1033
|
} yp_global_variable_read_node_t;
|
972
1034
|
|
973
1035
|
// GlobalVariableTargetNode
|
974
1036
|
//
|
975
|
-
// Type:
|
1037
|
+
// Type: YP_GLOBAL_VARIABLE_TARGET_NODE
|
976
1038
|
typedef struct yp_global_variable_target_node {
|
977
1039
|
yp_node_t base;
|
1040
|
+
yp_constant_id_t name;
|
978
1041
|
} yp_global_variable_target_node_t;
|
979
1042
|
|
980
1043
|
// GlobalVariableWriteNode
|
981
1044
|
//
|
982
|
-
// Type:
|
1045
|
+
// Type: YP_GLOBAL_VARIABLE_WRITE_NODE
|
983
1046
|
typedef struct yp_global_variable_write_node {
|
984
1047
|
yp_node_t base;
|
1048
|
+
yp_constant_id_t name;
|
985
1049
|
yp_location_t name_loc;
|
986
1050
|
struct yp_node *value;
|
987
1051
|
yp_location_t operator_loc;
|
@@ -989,7 +1053,7 @@ typedef struct yp_global_variable_write_node {
|
|
989
1053
|
|
990
1054
|
// HashNode
|
991
1055
|
//
|
992
|
-
// Type:
|
1056
|
+
// Type: YP_HASH_NODE
|
993
1057
|
typedef struct yp_hash_node {
|
994
1058
|
yp_node_t base;
|
995
1059
|
yp_location_t opening_loc;
|
@@ -999,7 +1063,7 @@ typedef struct yp_hash_node {
|
|
999
1063
|
|
1000
1064
|
// HashPatternNode
|
1001
1065
|
//
|
1002
|
-
// Type:
|
1066
|
+
// Type: YP_HASH_PATTERN_NODE
|
1003
1067
|
typedef struct yp_hash_pattern_node {
|
1004
1068
|
yp_node_t base;
|
1005
1069
|
struct yp_node *constant;
|
@@ -1011,7 +1075,7 @@ typedef struct yp_hash_pattern_node {
|
|
1011
1075
|
|
1012
1076
|
// IfNode
|
1013
1077
|
//
|
1014
|
-
// Type:
|
1078
|
+
// Type: YP_IF_NODE
|
1015
1079
|
typedef struct yp_if_node {
|
1016
1080
|
yp_node_t base;
|
1017
1081
|
yp_location_t if_keyword_loc;
|
@@ -1023,15 +1087,23 @@ typedef struct yp_if_node {
|
|
1023
1087
|
|
1024
1088
|
// ImaginaryNode
|
1025
1089
|
//
|
1026
|
-
// Type:
|
1090
|
+
// Type: YP_IMAGINARY_NODE
|
1027
1091
|
typedef struct yp_imaginary_node {
|
1028
1092
|
yp_node_t base;
|
1029
1093
|
struct yp_node *numeric;
|
1030
1094
|
} yp_imaginary_node_t;
|
1031
1095
|
|
1096
|
+
// ImplicitNode
|
1097
|
+
//
|
1098
|
+
// Type: YP_IMPLICIT_NODE
|
1099
|
+
typedef struct yp_implicit_node {
|
1100
|
+
yp_node_t base;
|
1101
|
+
struct yp_node *value;
|
1102
|
+
} yp_implicit_node_t;
|
1103
|
+
|
1032
1104
|
// InNode
|
1033
1105
|
//
|
1034
|
-
// Type:
|
1106
|
+
// Type: YP_IN_NODE
|
1035
1107
|
typedef struct yp_in_node {
|
1036
1108
|
yp_node_t base;
|
1037
1109
|
struct yp_node *pattern;
|
@@ -1042,7 +1114,7 @@ typedef struct yp_in_node {
|
|
1042
1114
|
|
1043
1115
|
// InstanceVariableAndWriteNode
|
1044
1116
|
//
|
1045
|
-
// Type:
|
1117
|
+
// Type: YP_INSTANCE_VARIABLE_AND_WRITE_NODE
|
1046
1118
|
typedef struct yp_instance_variable_and_write_node {
|
1047
1119
|
yp_node_t base;
|
1048
1120
|
yp_constant_id_t name;
|
@@ -1053,7 +1125,7 @@ typedef struct yp_instance_variable_and_write_node {
|
|
1053
1125
|
|
1054
1126
|
// InstanceVariableOperatorWriteNode
|
1055
1127
|
//
|
1056
|
-
// Type:
|
1128
|
+
// Type: YP_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE
|
1057
1129
|
typedef struct yp_instance_variable_operator_write_node {
|
1058
1130
|
yp_node_t base;
|
1059
1131
|
yp_constant_id_t name;
|
@@ -1065,7 +1137,7 @@ typedef struct yp_instance_variable_operator_write_node {
|
|
1065
1137
|
|
1066
1138
|
// InstanceVariableOrWriteNode
|
1067
1139
|
//
|
1068
|
-
// Type:
|
1140
|
+
// Type: YP_INSTANCE_VARIABLE_OR_WRITE_NODE
|
1069
1141
|
typedef struct yp_instance_variable_or_write_node {
|
1070
1142
|
yp_node_t base;
|
1071
1143
|
yp_constant_id_t name;
|
@@ -1076,7 +1148,7 @@ typedef struct yp_instance_variable_or_write_node {
|
|
1076
1148
|
|
1077
1149
|
// InstanceVariableReadNode
|
1078
1150
|
//
|
1079
|
-
// Type:
|
1151
|
+
// Type: YP_INSTANCE_VARIABLE_READ_NODE
|
1080
1152
|
typedef struct yp_instance_variable_read_node {
|
1081
1153
|
yp_node_t base;
|
1082
1154
|
yp_constant_id_t name;
|
@@ -1084,7 +1156,7 @@ typedef struct yp_instance_variable_read_node {
|
|
1084
1156
|
|
1085
1157
|
// InstanceVariableTargetNode
|
1086
1158
|
//
|
1087
|
-
// Type:
|
1159
|
+
// Type: YP_INSTANCE_VARIABLE_TARGET_NODE
|
1088
1160
|
typedef struct yp_instance_variable_target_node {
|
1089
1161
|
yp_node_t base;
|
1090
1162
|
yp_constant_id_t name;
|
@@ -1092,7 +1164,7 @@ typedef struct yp_instance_variable_target_node {
|
|
1092
1164
|
|
1093
1165
|
// InstanceVariableWriteNode
|
1094
1166
|
//
|
1095
|
-
// Type:
|
1167
|
+
// Type: YP_INSTANCE_VARIABLE_WRITE_NODE
|
1096
1168
|
typedef struct yp_instance_variable_write_node {
|
1097
1169
|
yp_node_t base;
|
1098
1170
|
yp_constant_id_t name;
|
@@ -1103,18 +1175,42 @@ typedef struct yp_instance_variable_write_node {
|
|
1103
1175
|
|
1104
1176
|
// IntegerNode
|
1105
1177
|
//
|
1106
|
-
// Type:
|
1178
|
+
// Type: YP_INTEGER_NODE
|
1179
|
+
// Flags:
|
1180
|
+
// YP_INTEGER_BASE_FLAGS_BINARY
|
1181
|
+
// YP_INTEGER_BASE_FLAGS_OCTAL
|
1182
|
+
// YP_INTEGER_BASE_FLAGS_DECIMAL
|
1183
|
+
// YP_INTEGER_BASE_FLAGS_HEXADECIMAL
|
1107
1184
|
typedef struct yp_integer_node {
|
1108
1185
|
yp_node_t base;
|
1109
1186
|
} yp_integer_node_t;
|
1110
1187
|
|
1111
|
-
//
|
1188
|
+
// InterpolatedMatchLastLineNode
|
1112
1189
|
//
|
1113
|
-
// Type:
|
1190
|
+
// Type: YP_INTERPOLATED_MATCH_LAST_LINE_NODE
|
1114
1191
|
// Flags:
|
1115
1192
|
// YP_REGULAR_EXPRESSION_FLAGS_IGNORE_CASE
|
1193
|
+
// YP_REGULAR_EXPRESSION_FLAGS_EXTENDED
|
1116
1194
|
// YP_REGULAR_EXPRESSION_FLAGS_MULTI_LINE
|
1195
|
+
// YP_REGULAR_EXPRESSION_FLAGS_EUC_JP
|
1196
|
+
// YP_REGULAR_EXPRESSION_FLAGS_ASCII_8BIT
|
1197
|
+
// YP_REGULAR_EXPRESSION_FLAGS_WINDOWS_31J
|
1198
|
+
// YP_REGULAR_EXPRESSION_FLAGS_UTF_8
|
1199
|
+
// YP_REGULAR_EXPRESSION_FLAGS_ONCE
|
1200
|
+
typedef struct yp_interpolated_match_last_line_node {
|
1201
|
+
yp_node_t base;
|
1202
|
+
yp_location_t opening_loc;
|
1203
|
+
struct yp_node_list parts;
|
1204
|
+
yp_location_t closing_loc;
|
1205
|
+
} yp_interpolated_match_last_line_node_t;
|
1206
|
+
|
1207
|
+
// InterpolatedRegularExpressionNode
|
1208
|
+
//
|
1209
|
+
// Type: YP_INTERPOLATED_REGULAR_EXPRESSION_NODE
|
1210
|
+
// Flags:
|
1211
|
+
// YP_REGULAR_EXPRESSION_FLAGS_IGNORE_CASE
|
1117
1212
|
// YP_REGULAR_EXPRESSION_FLAGS_EXTENDED
|
1213
|
+
// YP_REGULAR_EXPRESSION_FLAGS_MULTI_LINE
|
1118
1214
|
// YP_REGULAR_EXPRESSION_FLAGS_EUC_JP
|
1119
1215
|
// YP_REGULAR_EXPRESSION_FLAGS_ASCII_8BIT
|
1120
1216
|
// YP_REGULAR_EXPRESSION_FLAGS_WINDOWS_31J
|
@@ -1129,7 +1225,7 @@ typedef struct yp_interpolated_regular_expression_node {
|
|
1129
1225
|
|
1130
1226
|
// InterpolatedStringNode
|
1131
1227
|
//
|
1132
|
-
// Type:
|
1228
|
+
// Type: YP_INTERPOLATED_STRING_NODE
|
1133
1229
|
typedef struct yp_interpolated_string_node {
|
1134
1230
|
yp_node_t base;
|
1135
1231
|
yp_location_t opening_loc;
|
@@ -1139,7 +1235,7 @@ typedef struct yp_interpolated_string_node {
|
|
1139
1235
|
|
1140
1236
|
// InterpolatedSymbolNode
|
1141
1237
|
//
|
1142
|
-
// Type:
|
1238
|
+
// Type: YP_INTERPOLATED_SYMBOL_NODE
|
1143
1239
|
typedef struct yp_interpolated_symbol_node {
|
1144
1240
|
yp_node_t base;
|
1145
1241
|
yp_location_t opening_loc;
|
@@ -1149,7 +1245,7 @@ typedef struct yp_interpolated_symbol_node {
|
|
1149
1245
|
|
1150
1246
|
// InterpolatedXStringNode
|
1151
1247
|
//
|
1152
|
-
// Type:
|
1248
|
+
// Type: YP_INTERPOLATED_X_STRING_NODE
|
1153
1249
|
typedef struct yp_interpolated_x_string_node {
|
1154
1250
|
yp_node_t base;
|
1155
1251
|
yp_location_t opening_loc;
|
@@ -1159,7 +1255,7 @@ typedef struct yp_interpolated_x_string_node {
|
|
1159
1255
|
|
1160
1256
|
// KeywordHashNode
|
1161
1257
|
//
|
1162
|
-
// Type:
|
1258
|
+
// Type: YP_KEYWORD_HASH_NODE
|
1163
1259
|
typedef struct yp_keyword_hash_node {
|
1164
1260
|
yp_node_t base;
|
1165
1261
|
struct yp_node_list elements;
|
@@ -1167,25 +1263,27 @@ typedef struct yp_keyword_hash_node {
|
|
1167
1263
|
|
1168
1264
|
// KeywordParameterNode
|
1169
1265
|
//
|
1170
|
-
// Type:
|
1266
|
+
// Type: YP_KEYWORD_PARAMETER_NODE
|
1171
1267
|
typedef struct yp_keyword_parameter_node {
|
1172
1268
|
yp_node_t base;
|
1269
|
+
yp_constant_id_t name;
|
1173
1270
|
yp_location_t name_loc;
|
1174
1271
|
struct yp_node *value;
|
1175
1272
|
} yp_keyword_parameter_node_t;
|
1176
1273
|
|
1177
1274
|
// KeywordRestParameterNode
|
1178
1275
|
//
|
1179
|
-
// Type:
|
1276
|
+
// Type: YP_KEYWORD_REST_PARAMETER_NODE
|
1180
1277
|
typedef struct yp_keyword_rest_parameter_node {
|
1181
1278
|
yp_node_t base;
|
1182
|
-
|
1279
|
+
yp_constant_id_t name;
|
1183
1280
|
yp_location_t name_loc;
|
1281
|
+
yp_location_t operator_loc;
|
1184
1282
|
} yp_keyword_rest_parameter_node_t;
|
1185
1283
|
|
1186
1284
|
// LambdaNode
|
1187
1285
|
//
|
1188
|
-
// Type:
|
1286
|
+
// Type: YP_LAMBDA_NODE
|
1189
1287
|
typedef struct yp_lambda_node {
|
1190
1288
|
yp_node_t base;
|
1191
1289
|
yp_constant_id_list_t locals;
|
@@ -1198,7 +1296,7 @@ typedef struct yp_lambda_node {
|
|
1198
1296
|
|
1199
1297
|
// LocalVariableAndWriteNode
|
1200
1298
|
//
|
1201
|
-
// Type:
|
1299
|
+
// Type: YP_LOCAL_VARIABLE_AND_WRITE_NODE
|
1202
1300
|
typedef struct yp_local_variable_and_write_node {
|
1203
1301
|
yp_node_t base;
|
1204
1302
|
yp_location_t name_loc;
|
@@ -1210,7 +1308,7 @@ typedef struct yp_local_variable_and_write_node {
|
|
1210
1308
|
|
1211
1309
|
// LocalVariableOperatorWriteNode
|
1212
1310
|
//
|
1213
|
-
// Type:
|
1311
|
+
// Type: YP_LOCAL_VARIABLE_OPERATOR_WRITE_NODE
|
1214
1312
|
typedef struct yp_local_variable_operator_write_node {
|
1215
1313
|
yp_node_t base;
|
1216
1314
|
yp_location_t name_loc;
|
@@ -1223,7 +1321,7 @@ typedef struct yp_local_variable_operator_write_node {
|
|
1223
1321
|
|
1224
1322
|
// LocalVariableOrWriteNode
|
1225
1323
|
//
|
1226
|
-
// Type:
|
1324
|
+
// Type: YP_LOCAL_VARIABLE_OR_WRITE_NODE
|
1227
1325
|
typedef struct yp_local_variable_or_write_node {
|
1228
1326
|
yp_node_t base;
|
1229
1327
|
yp_location_t name_loc;
|
@@ -1235,7 +1333,7 @@ typedef struct yp_local_variable_or_write_node {
|
|
1235
1333
|
|
1236
1334
|
// LocalVariableReadNode
|
1237
1335
|
//
|
1238
|
-
// Type:
|
1336
|
+
// Type: YP_LOCAL_VARIABLE_READ_NODE
|
1239
1337
|
typedef struct yp_local_variable_read_node {
|
1240
1338
|
yp_node_t base;
|
1241
1339
|
yp_constant_id_t name;
|
@@ -1244,7 +1342,7 @@ typedef struct yp_local_variable_read_node {
|
|
1244
1342
|
|
1245
1343
|
// LocalVariableTargetNode
|
1246
1344
|
//
|
1247
|
-
// Type:
|
1345
|
+
// Type: YP_LOCAL_VARIABLE_TARGET_NODE
|
1248
1346
|
typedef struct yp_local_variable_target_node {
|
1249
1347
|
yp_node_t base;
|
1250
1348
|
yp_constant_id_t name;
|
@@ -1253,7 +1351,7 @@ typedef struct yp_local_variable_target_node {
|
|
1253
1351
|
|
1254
1352
|
// LocalVariableWriteNode
|
1255
1353
|
//
|
1256
|
-
// Type:
|
1354
|
+
// Type: YP_LOCAL_VARIABLE_WRITE_NODE
|
1257
1355
|
typedef struct yp_local_variable_write_node {
|
1258
1356
|
yp_node_t base;
|
1259
1357
|
yp_constant_id_t name;
|
@@ -1263,9 +1361,29 @@ typedef struct yp_local_variable_write_node {
|
|
1263
1361
|
yp_location_t operator_loc;
|
1264
1362
|
} yp_local_variable_write_node_t;
|
1265
1363
|
|
1364
|
+
// MatchLastLineNode
|
1365
|
+
//
|
1366
|
+
// Type: YP_MATCH_LAST_LINE_NODE
|
1367
|
+
// Flags:
|
1368
|
+
// YP_REGULAR_EXPRESSION_FLAGS_IGNORE_CASE
|
1369
|
+
// YP_REGULAR_EXPRESSION_FLAGS_EXTENDED
|
1370
|
+
// YP_REGULAR_EXPRESSION_FLAGS_MULTI_LINE
|
1371
|
+
// YP_REGULAR_EXPRESSION_FLAGS_EUC_JP
|
1372
|
+
// YP_REGULAR_EXPRESSION_FLAGS_ASCII_8BIT
|
1373
|
+
// YP_REGULAR_EXPRESSION_FLAGS_WINDOWS_31J
|
1374
|
+
// YP_REGULAR_EXPRESSION_FLAGS_UTF_8
|
1375
|
+
// YP_REGULAR_EXPRESSION_FLAGS_ONCE
|
1376
|
+
typedef struct yp_match_last_line_node {
|
1377
|
+
yp_node_t base;
|
1378
|
+
yp_location_t opening_loc;
|
1379
|
+
yp_location_t content_loc;
|
1380
|
+
yp_location_t closing_loc;
|
1381
|
+
yp_string_t unescaped;
|
1382
|
+
} yp_match_last_line_node_t;
|
1383
|
+
|
1266
1384
|
// MatchPredicateNode
|
1267
1385
|
//
|
1268
|
-
// Type:
|
1386
|
+
// Type: YP_MATCH_PREDICATE_NODE
|
1269
1387
|
typedef struct yp_match_predicate_node {
|
1270
1388
|
yp_node_t base;
|
1271
1389
|
struct yp_node *value;
|
@@ -1275,7 +1393,7 @@ typedef struct yp_match_predicate_node {
|
|
1275
1393
|
|
1276
1394
|
// MatchRequiredNode
|
1277
1395
|
//
|
1278
|
-
// Type:
|
1396
|
+
// Type: YP_MATCH_REQUIRED_NODE
|
1279
1397
|
typedef struct yp_match_required_node {
|
1280
1398
|
yp_node_t base;
|
1281
1399
|
struct yp_node *value;
|
@@ -1283,16 +1401,25 @@ typedef struct yp_match_required_node {
|
|
1283
1401
|
yp_location_t operator_loc;
|
1284
1402
|
} yp_match_required_node_t;
|
1285
1403
|
|
1404
|
+
// MatchWriteNode
|
1405
|
+
//
|
1406
|
+
// Type: YP_MATCH_WRITE_NODE
|
1407
|
+
typedef struct yp_match_write_node {
|
1408
|
+
yp_node_t base;
|
1409
|
+
struct yp_call_node *call;
|
1410
|
+
yp_constant_id_list_t locals;
|
1411
|
+
} yp_match_write_node_t;
|
1412
|
+
|
1286
1413
|
// MissingNode
|
1287
1414
|
//
|
1288
|
-
// Type:
|
1415
|
+
// Type: YP_MISSING_NODE
|
1289
1416
|
typedef struct yp_missing_node {
|
1290
1417
|
yp_node_t base;
|
1291
1418
|
} yp_missing_node_t;
|
1292
1419
|
|
1293
1420
|
// ModuleNode
|
1294
1421
|
//
|
1295
|
-
// Type:
|
1422
|
+
// Type: YP_MODULE_NODE
|
1296
1423
|
typedef struct yp_module_node {
|
1297
1424
|
yp_node_t base;
|
1298
1425
|
yp_constant_id_list_t locals;
|
@@ -1300,24 +1427,34 @@ typedef struct yp_module_node {
|
|
1300
1427
|
struct yp_node *constant_path;
|
1301
1428
|
struct yp_node *body;
|
1302
1429
|
yp_location_t end_keyword_loc;
|
1303
|
-
|
1430
|
+
yp_constant_id_t name;
|
1304
1431
|
} yp_module_node_t;
|
1305
1432
|
|
1433
|
+
// MultiTargetNode
|
1434
|
+
//
|
1435
|
+
// Type: YP_MULTI_TARGET_NODE
|
1436
|
+
typedef struct yp_multi_target_node {
|
1437
|
+
yp_node_t base;
|
1438
|
+
struct yp_node_list targets;
|
1439
|
+
yp_location_t lparen_loc;
|
1440
|
+
yp_location_t rparen_loc;
|
1441
|
+
} yp_multi_target_node_t;
|
1442
|
+
|
1306
1443
|
// MultiWriteNode
|
1307
1444
|
//
|
1308
|
-
// Type:
|
1445
|
+
// Type: YP_MULTI_WRITE_NODE
|
1309
1446
|
typedef struct yp_multi_write_node {
|
1310
1447
|
yp_node_t base;
|
1311
1448
|
struct yp_node_list targets;
|
1312
|
-
yp_location_t operator_loc;
|
1313
|
-
struct yp_node *value;
|
1314
1449
|
yp_location_t lparen_loc;
|
1315
1450
|
yp_location_t rparen_loc;
|
1451
|
+
yp_location_t operator_loc;
|
1452
|
+
struct yp_node *value;
|
1316
1453
|
} yp_multi_write_node_t;
|
1317
1454
|
|
1318
1455
|
// NextNode
|
1319
1456
|
//
|
1320
|
-
// Type:
|
1457
|
+
// Type: YP_NEXT_NODE
|
1321
1458
|
typedef struct yp_next_node {
|
1322
1459
|
yp_node_t base;
|
1323
1460
|
struct yp_arguments_node *arguments;
|
@@ -1326,14 +1463,14 @@ typedef struct yp_next_node {
|
|
1326
1463
|
|
1327
1464
|
// NilNode
|
1328
1465
|
//
|
1329
|
-
// Type:
|
1466
|
+
// Type: YP_NIL_NODE
|
1330
1467
|
typedef struct yp_nil_node {
|
1331
1468
|
yp_node_t base;
|
1332
1469
|
} yp_nil_node_t;
|
1333
1470
|
|
1334
1471
|
// NoKeywordsParameterNode
|
1335
1472
|
//
|
1336
|
-
// Type:
|
1473
|
+
// Type: YP_NO_KEYWORDS_PARAMETER_NODE
|
1337
1474
|
typedef struct yp_no_keywords_parameter_node {
|
1338
1475
|
yp_node_t base;
|
1339
1476
|
yp_location_t operator_loc;
|
@@ -1342,7 +1479,7 @@ typedef struct yp_no_keywords_parameter_node {
|
|
1342
1479
|
|
1343
1480
|
// NumberedReferenceReadNode
|
1344
1481
|
//
|
1345
|
-
// Type:
|
1482
|
+
// Type: YP_NUMBERED_REFERENCE_READ_NODE
|
1346
1483
|
typedef struct yp_numbered_reference_read_node {
|
1347
1484
|
yp_node_t base;
|
1348
1485
|
uint32_t number;
|
@@ -1350,7 +1487,7 @@ typedef struct yp_numbered_reference_read_node {
|
|
1350
1487
|
|
1351
1488
|
// OptionalParameterNode
|
1352
1489
|
//
|
1353
|
-
// Type:
|
1490
|
+
// Type: YP_OPTIONAL_PARAMETER_NODE
|
1354
1491
|
typedef struct yp_optional_parameter_node {
|
1355
1492
|
yp_node_t base;
|
1356
1493
|
yp_constant_id_t name;
|
@@ -1361,7 +1498,7 @@ typedef struct yp_optional_parameter_node {
|
|
1361
1498
|
|
1362
1499
|
// OrNode
|
1363
1500
|
//
|
1364
|
-
// Type:
|
1501
|
+
// Type: YP_OR_NODE
|
1365
1502
|
typedef struct yp_or_node {
|
1366
1503
|
yp_node_t base;
|
1367
1504
|
struct yp_node *left;
|
@@ -1371,13 +1508,13 @@ typedef struct yp_or_node {
|
|
1371
1508
|
|
1372
1509
|
// ParametersNode
|
1373
1510
|
//
|
1374
|
-
// Type:
|
1511
|
+
// Type: YP_PARAMETERS_NODE
|
1375
1512
|
typedef struct yp_parameters_node {
|
1376
1513
|
yp_node_t base;
|
1377
1514
|
struct yp_node_list requireds;
|
1378
1515
|
struct yp_node_list optionals;
|
1379
|
-
struct yp_node_list posts;
|
1380
1516
|
struct yp_rest_parameter_node *rest;
|
1517
|
+
struct yp_node_list posts;
|
1381
1518
|
struct yp_node_list keywords;
|
1382
1519
|
struct yp_node *keyword_rest;
|
1383
1520
|
struct yp_block_parameter_node *block;
|
@@ -1385,7 +1522,7 @@ typedef struct yp_parameters_node {
|
|
1385
1522
|
|
1386
1523
|
// ParenthesesNode
|
1387
1524
|
//
|
1388
|
-
// Type:
|
1525
|
+
// Type: YP_PARENTHESES_NODE
|
1389
1526
|
typedef struct yp_parentheses_node {
|
1390
1527
|
yp_node_t base;
|
1391
1528
|
struct yp_node *body;
|
@@ -1395,7 +1532,7 @@ typedef struct yp_parentheses_node {
|
|
1395
1532
|
|
1396
1533
|
// PinnedExpressionNode
|
1397
1534
|
//
|
1398
|
-
// Type:
|
1535
|
+
// Type: YP_PINNED_EXPRESSION_NODE
|
1399
1536
|
typedef struct yp_pinned_expression_node {
|
1400
1537
|
yp_node_t base;
|
1401
1538
|
struct yp_node *expression;
|
@@ -1406,7 +1543,7 @@ typedef struct yp_pinned_expression_node {
|
|
1406
1543
|
|
1407
1544
|
// PinnedVariableNode
|
1408
1545
|
//
|
1409
|
-
// Type:
|
1546
|
+
// Type: YP_PINNED_VARIABLE_NODE
|
1410
1547
|
typedef struct yp_pinned_variable_node {
|
1411
1548
|
yp_node_t base;
|
1412
1549
|
struct yp_node *variable;
|
@@ -1415,7 +1552,7 @@ typedef struct yp_pinned_variable_node {
|
|
1415
1552
|
|
1416
1553
|
// PostExecutionNode
|
1417
1554
|
//
|
1418
|
-
// Type:
|
1555
|
+
// Type: YP_POST_EXECUTION_NODE
|
1419
1556
|
typedef struct yp_post_execution_node {
|
1420
1557
|
yp_node_t base;
|
1421
1558
|
struct yp_statements_node *statements;
|
@@ -1426,7 +1563,7 @@ typedef struct yp_post_execution_node {
|
|
1426
1563
|
|
1427
1564
|
// PreExecutionNode
|
1428
1565
|
//
|
1429
|
-
// Type:
|
1566
|
+
// Type: YP_PRE_EXECUTION_NODE
|
1430
1567
|
typedef struct yp_pre_execution_node {
|
1431
1568
|
yp_node_t base;
|
1432
1569
|
struct yp_statements_node *statements;
|
@@ -1437,7 +1574,7 @@ typedef struct yp_pre_execution_node {
|
|
1437
1574
|
|
1438
1575
|
// ProgramNode
|
1439
1576
|
//
|
1440
|
-
// Type:
|
1577
|
+
// Type: YP_PROGRAM_NODE
|
1441
1578
|
typedef struct yp_program_node {
|
1442
1579
|
yp_node_t base;
|
1443
1580
|
yp_constant_id_list_t locals;
|
@@ -1446,7 +1583,7 @@ typedef struct yp_program_node {
|
|
1446
1583
|
|
1447
1584
|
// RangeNode
|
1448
1585
|
//
|
1449
|
-
// Type:
|
1586
|
+
// Type: YP_RANGE_NODE
|
1450
1587
|
// Flags:
|
1451
1588
|
// YP_RANGE_FLAGS_EXCLUDE_END
|
1452
1589
|
typedef struct yp_range_node {
|
@@ -1458,7 +1595,7 @@ typedef struct yp_range_node {
|
|
1458
1595
|
|
1459
1596
|
// RationalNode
|
1460
1597
|
//
|
1461
|
-
// Type:
|
1598
|
+
// Type: YP_RATIONAL_NODE
|
1462
1599
|
typedef struct yp_rational_node {
|
1463
1600
|
yp_node_t base;
|
1464
1601
|
struct yp_node *numeric;
|
@@ -1466,18 +1603,18 @@ typedef struct yp_rational_node {
|
|
1466
1603
|
|
1467
1604
|
// RedoNode
|
1468
1605
|
//
|
1469
|
-
// Type:
|
1606
|
+
// Type: YP_REDO_NODE
|
1470
1607
|
typedef struct yp_redo_node {
|
1471
1608
|
yp_node_t base;
|
1472
1609
|
} yp_redo_node_t;
|
1473
1610
|
|
1474
1611
|
// RegularExpressionNode
|
1475
1612
|
//
|
1476
|
-
// Type:
|
1613
|
+
// Type: YP_REGULAR_EXPRESSION_NODE
|
1477
1614
|
// Flags:
|
1478
1615
|
// YP_REGULAR_EXPRESSION_FLAGS_IGNORE_CASE
|
1479
|
-
// YP_REGULAR_EXPRESSION_FLAGS_MULTI_LINE
|
1480
1616
|
// YP_REGULAR_EXPRESSION_FLAGS_EXTENDED
|
1617
|
+
// YP_REGULAR_EXPRESSION_FLAGS_MULTI_LINE
|
1481
1618
|
// YP_REGULAR_EXPRESSION_FLAGS_EUC_JP
|
1482
1619
|
// YP_REGULAR_EXPRESSION_FLAGS_ASCII_8BIT
|
1483
1620
|
// YP_REGULAR_EXPRESSION_FLAGS_WINDOWS_31J
|
@@ -1493,7 +1630,7 @@ typedef struct yp_regular_expression_node {
|
|
1493
1630
|
|
1494
1631
|
// RequiredDestructuredParameterNode
|
1495
1632
|
//
|
1496
|
-
// Type:
|
1633
|
+
// Type: YP_REQUIRED_DESTRUCTURED_PARAMETER_NODE
|
1497
1634
|
typedef struct yp_required_destructured_parameter_node {
|
1498
1635
|
yp_node_t base;
|
1499
1636
|
struct yp_node_list parameters;
|
@@ -1503,7 +1640,7 @@ typedef struct yp_required_destructured_parameter_node {
|
|
1503
1640
|
|
1504
1641
|
// RequiredParameterNode
|
1505
1642
|
//
|
1506
|
-
// Type:
|
1643
|
+
// Type: YP_REQUIRED_PARAMETER_NODE
|
1507
1644
|
typedef struct yp_required_parameter_node {
|
1508
1645
|
yp_node_t base;
|
1509
1646
|
yp_constant_id_t name;
|
@@ -1511,7 +1648,7 @@ typedef struct yp_required_parameter_node {
|
|
1511
1648
|
|
1512
1649
|
// RescueModifierNode
|
1513
1650
|
//
|
1514
|
-
// Type:
|
1651
|
+
// Type: YP_RESCUE_MODIFIER_NODE
|
1515
1652
|
typedef struct yp_rescue_modifier_node {
|
1516
1653
|
yp_node_t base;
|
1517
1654
|
struct yp_node *expression;
|
@@ -1521,7 +1658,7 @@ typedef struct yp_rescue_modifier_node {
|
|
1521
1658
|
|
1522
1659
|
// RescueNode
|
1523
1660
|
//
|
1524
|
-
// Type:
|
1661
|
+
// Type: YP_RESCUE_NODE
|
1525
1662
|
typedef struct yp_rescue_node {
|
1526
1663
|
yp_node_t base;
|
1527
1664
|
yp_location_t keyword_loc;
|
@@ -1534,23 +1671,24 @@ typedef struct yp_rescue_node {
|
|
1534
1671
|
|
1535
1672
|
// RestParameterNode
|
1536
1673
|
//
|
1537
|
-
// Type:
|
1674
|
+
// Type: YP_REST_PARAMETER_NODE
|
1538
1675
|
typedef struct yp_rest_parameter_node {
|
1539
1676
|
yp_node_t base;
|
1540
|
-
|
1677
|
+
yp_constant_id_t name;
|
1541
1678
|
yp_location_t name_loc;
|
1679
|
+
yp_location_t operator_loc;
|
1542
1680
|
} yp_rest_parameter_node_t;
|
1543
1681
|
|
1544
1682
|
// RetryNode
|
1545
1683
|
//
|
1546
|
-
// Type:
|
1684
|
+
// Type: YP_RETRY_NODE
|
1547
1685
|
typedef struct yp_retry_node {
|
1548
1686
|
yp_node_t base;
|
1549
1687
|
} yp_retry_node_t;
|
1550
1688
|
|
1551
1689
|
// ReturnNode
|
1552
1690
|
//
|
1553
|
-
// Type:
|
1691
|
+
// Type: YP_RETURN_NODE
|
1554
1692
|
typedef struct yp_return_node {
|
1555
1693
|
yp_node_t base;
|
1556
1694
|
yp_location_t keyword_loc;
|
@@ -1559,14 +1697,14 @@ typedef struct yp_return_node {
|
|
1559
1697
|
|
1560
1698
|
// SelfNode
|
1561
1699
|
//
|
1562
|
-
// Type:
|
1700
|
+
// Type: YP_SELF_NODE
|
1563
1701
|
typedef struct yp_self_node {
|
1564
1702
|
yp_node_t base;
|
1565
1703
|
} yp_self_node_t;
|
1566
1704
|
|
1567
1705
|
// SingletonClassNode
|
1568
1706
|
//
|
1569
|
-
// Type:
|
1707
|
+
// Type: YP_SINGLETON_CLASS_NODE
|
1570
1708
|
typedef struct yp_singleton_class_node {
|
1571
1709
|
yp_node_t base;
|
1572
1710
|
yp_constant_id_list_t locals;
|
@@ -1579,14 +1717,14 @@ typedef struct yp_singleton_class_node {
|
|
1579
1717
|
|
1580
1718
|
// SourceEncodingNode
|
1581
1719
|
//
|
1582
|
-
// Type:
|
1720
|
+
// Type: YP_SOURCE_ENCODING_NODE
|
1583
1721
|
typedef struct yp_source_encoding_node {
|
1584
1722
|
yp_node_t base;
|
1585
1723
|
} yp_source_encoding_node_t;
|
1586
1724
|
|
1587
1725
|
// SourceFileNode
|
1588
1726
|
//
|
1589
|
-
// Type:
|
1727
|
+
// Type: YP_SOURCE_FILE_NODE
|
1590
1728
|
typedef struct yp_source_file_node {
|
1591
1729
|
yp_node_t base;
|
1592
1730
|
yp_string_t filepath;
|
@@ -1594,14 +1732,14 @@ typedef struct yp_source_file_node {
|
|
1594
1732
|
|
1595
1733
|
// SourceLineNode
|
1596
1734
|
//
|
1597
|
-
// Type:
|
1735
|
+
// Type: YP_SOURCE_LINE_NODE
|
1598
1736
|
typedef struct yp_source_line_node {
|
1599
1737
|
yp_node_t base;
|
1600
1738
|
} yp_source_line_node_t;
|
1601
1739
|
|
1602
1740
|
// SplatNode
|
1603
1741
|
//
|
1604
|
-
// Type:
|
1742
|
+
// Type: YP_SPLAT_NODE
|
1605
1743
|
typedef struct yp_splat_node {
|
1606
1744
|
yp_node_t base;
|
1607
1745
|
yp_location_t operator_loc;
|
@@ -1610,7 +1748,7 @@ typedef struct yp_splat_node {
|
|
1610
1748
|
|
1611
1749
|
// StatementsNode
|
1612
1750
|
//
|
1613
|
-
// Type:
|
1751
|
+
// Type: YP_STATEMENTS_NODE
|
1614
1752
|
typedef struct yp_statements_node {
|
1615
1753
|
yp_node_t base;
|
1616
1754
|
struct yp_node_list body;
|
@@ -1618,7 +1756,7 @@ typedef struct yp_statements_node {
|
|
1618
1756
|
|
1619
1757
|
// StringConcatNode
|
1620
1758
|
//
|
1621
|
-
// Type:
|
1759
|
+
// Type: YP_STRING_CONCAT_NODE
|
1622
1760
|
typedef struct yp_string_concat_node {
|
1623
1761
|
yp_node_t base;
|
1624
1762
|
struct yp_node *left;
|
@@ -1627,7 +1765,9 @@ typedef struct yp_string_concat_node {
|
|
1627
1765
|
|
1628
1766
|
// StringNode
|
1629
1767
|
//
|
1630
|
-
// Type:
|
1768
|
+
// Type: YP_STRING_NODE
|
1769
|
+
// Flags:
|
1770
|
+
// YP_STRING_FLAGS_FROZEN
|
1631
1771
|
typedef struct yp_string_node {
|
1632
1772
|
yp_node_t base;
|
1633
1773
|
yp_location_t opening_loc;
|
@@ -1638,7 +1778,7 @@ typedef struct yp_string_node {
|
|
1638
1778
|
|
1639
1779
|
// SuperNode
|
1640
1780
|
//
|
1641
|
-
// Type:
|
1781
|
+
// Type: YP_SUPER_NODE
|
1642
1782
|
typedef struct yp_super_node {
|
1643
1783
|
yp_node_t base;
|
1644
1784
|
yp_location_t keyword_loc;
|
@@ -1650,7 +1790,7 @@ typedef struct yp_super_node {
|
|
1650
1790
|
|
1651
1791
|
// SymbolNode
|
1652
1792
|
//
|
1653
|
-
// Type:
|
1793
|
+
// Type: YP_SYMBOL_NODE
|
1654
1794
|
typedef struct yp_symbol_node {
|
1655
1795
|
yp_node_t base;
|
1656
1796
|
yp_location_t opening_loc;
|
@@ -1661,14 +1801,14 @@ typedef struct yp_symbol_node {
|
|
1661
1801
|
|
1662
1802
|
// TrueNode
|
1663
1803
|
//
|
1664
|
-
// Type:
|
1804
|
+
// Type: YP_TRUE_NODE
|
1665
1805
|
typedef struct yp_true_node {
|
1666
1806
|
yp_node_t base;
|
1667
1807
|
} yp_true_node_t;
|
1668
1808
|
|
1669
1809
|
// UndefNode
|
1670
1810
|
//
|
1671
|
-
// Type:
|
1811
|
+
// Type: YP_UNDEF_NODE
|
1672
1812
|
typedef struct yp_undef_node {
|
1673
1813
|
yp_node_t base;
|
1674
1814
|
struct yp_node_list names;
|
@@ -1677,7 +1817,7 @@ typedef struct yp_undef_node {
|
|
1677
1817
|
|
1678
1818
|
// UnlessNode
|
1679
1819
|
//
|
1680
|
-
// Type:
|
1820
|
+
// Type: YP_UNLESS_NODE
|
1681
1821
|
typedef struct yp_unless_node {
|
1682
1822
|
yp_node_t base;
|
1683
1823
|
yp_location_t keyword_loc;
|
@@ -1689,7 +1829,7 @@ typedef struct yp_unless_node {
|
|
1689
1829
|
|
1690
1830
|
// UntilNode
|
1691
1831
|
//
|
1692
|
-
// Type:
|
1832
|
+
// Type: YP_UNTIL_NODE
|
1693
1833
|
// Flags:
|
1694
1834
|
// YP_LOOP_FLAGS_BEGIN_MODIFIER
|
1695
1835
|
typedef struct yp_until_node {
|
@@ -1702,7 +1842,7 @@ typedef struct yp_until_node {
|
|
1702
1842
|
|
1703
1843
|
// WhenNode
|
1704
1844
|
//
|
1705
|
-
// Type:
|
1845
|
+
// Type: YP_WHEN_NODE
|
1706
1846
|
typedef struct yp_when_node {
|
1707
1847
|
yp_node_t base;
|
1708
1848
|
yp_location_t keyword_loc;
|
@@ -1712,7 +1852,7 @@ typedef struct yp_when_node {
|
|
1712
1852
|
|
1713
1853
|
// WhileNode
|
1714
1854
|
//
|
1715
|
-
// Type:
|
1855
|
+
// Type: YP_WHILE_NODE
|
1716
1856
|
// Flags:
|
1717
1857
|
// YP_LOOP_FLAGS_BEGIN_MODIFIER
|
1718
1858
|
typedef struct yp_while_node {
|
@@ -1725,7 +1865,7 @@ typedef struct yp_while_node {
|
|
1725
1865
|
|
1726
1866
|
// XStringNode
|
1727
1867
|
//
|
1728
|
-
// Type:
|
1868
|
+
// Type: YP_X_STRING_NODE
|
1729
1869
|
typedef struct yp_x_string_node {
|
1730
1870
|
yp_node_t base;
|
1731
1871
|
yp_location_t opening_loc;
|
@@ -1736,7 +1876,7 @@ typedef struct yp_x_string_node {
|
|
1736
1876
|
|
1737
1877
|
// YieldNode
|
1738
1878
|
//
|
1739
|
-
// Type:
|
1879
|
+
// Type: YP_YIELD_NODE
|
1740
1880
|
typedef struct yp_yield_node {
|
1741
1881
|
yp_node_t base;
|
1742
1882
|
yp_location_t keyword_loc;
|
@@ -1747,30 +1887,43 @@ typedef struct yp_yield_node {
|
|
1747
1887
|
|
1748
1888
|
// CallNodeFlags
|
1749
1889
|
typedef enum {
|
1750
|
-
YP_CALL_NODE_FLAGS_SAFE_NAVIGATION = 1 <<
|
1751
|
-
YP_CALL_NODE_FLAGS_VARIABLE_CALL = 1 <<
|
1890
|
+
YP_CALL_NODE_FLAGS_SAFE_NAVIGATION = 1 << 2,
|
1891
|
+
YP_CALL_NODE_FLAGS_VARIABLE_CALL = 1 << 3,
|
1752
1892
|
} yp_call_node_flags_t;
|
1753
1893
|
|
1894
|
+
// IntegerBaseFlags
|
1895
|
+
typedef enum {
|
1896
|
+
YP_INTEGER_BASE_FLAGS_BINARY = 1 << 2,
|
1897
|
+
YP_INTEGER_BASE_FLAGS_OCTAL = 1 << 3,
|
1898
|
+
YP_INTEGER_BASE_FLAGS_DECIMAL = 1 << 4,
|
1899
|
+
YP_INTEGER_BASE_FLAGS_HEXADECIMAL = 1 << 5,
|
1900
|
+
} yp_integer_base_flags_t;
|
1901
|
+
|
1754
1902
|
// LoopFlags
|
1755
1903
|
typedef enum {
|
1756
|
-
YP_LOOP_FLAGS_BEGIN_MODIFIER = 1 <<
|
1904
|
+
YP_LOOP_FLAGS_BEGIN_MODIFIER = 1 << 2,
|
1757
1905
|
} yp_loop_flags_t;
|
1758
1906
|
|
1759
1907
|
// RangeFlags
|
1760
1908
|
typedef enum {
|
1761
|
-
YP_RANGE_FLAGS_EXCLUDE_END = 1 <<
|
1909
|
+
YP_RANGE_FLAGS_EXCLUDE_END = 1 << 2,
|
1762
1910
|
} yp_range_flags_t;
|
1763
1911
|
|
1764
1912
|
// RegularExpressionFlags
|
1765
1913
|
typedef enum {
|
1766
|
-
YP_REGULAR_EXPRESSION_FLAGS_IGNORE_CASE = 1 <<
|
1767
|
-
YP_REGULAR_EXPRESSION_FLAGS_MULTI_LINE = 1 << 2,
|
1914
|
+
YP_REGULAR_EXPRESSION_FLAGS_IGNORE_CASE = 1 << 2,
|
1768
1915
|
YP_REGULAR_EXPRESSION_FLAGS_EXTENDED = 1 << 3,
|
1769
|
-
|
1770
|
-
|
1771
|
-
|
1772
|
-
|
1773
|
-
|
1916
|
+
YP_REGULAR_EXPRESSION_FLAGS_MULTI_LINE = 1 << 4,
|
1917
|
+
YP_REGULAR_EXPRESSION_FLAGS_EUC_JP = 1 << 5,
|
1918
|
+
YP_REGULAR_EXPRESSION_FLAGS_ASCII_8BIT = 1 << 6,
|
1919
|
+
YP_REGULAR_EXPRESSION_FLAGS_WINDOWS_31J = 1 << 7,
|
1920
|
+
YP_REGULAR_EXPRESSION_FLAGS_UTF_8 = 1 << 8,
|
1921
|
+
YP_REGULAR_EXPRESSION_FLAGS_ONCE = 1 << 9,
|
1774
1922
|
} yp_regular_expression_flags_t;
|
1775
1923
|
|
1924
|
+
// StringFlags
|
1925
|
+
typedef enum {
|
1926
|
+
YP_STRING_FLAGS_FROZEN = 1 << 2,
|
1927
|
+
} yp_string_flags_t;
|
1928
|
+
|
1776
1929
|
#endif // YARP_AST_H
|