prism 0.17.1 → 0.19.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 +60 -1
- data/Makefile +5 -5
- data/README.md +4 -3
- data/config.yml +214 -68
- data/docs/build_system.md +6 -6
- data/docs/building.md +10 -3
- data/docs/configuration.md +11 -9
- data/docs/encoding.md +92 -88
- data/docs/heredocs.md +1 -1
- data/docs/javascript.md +29 -1
- data/docs/local_variable_depth.md +229 -0
- data/docs/ruby_api.md +16 -0
- data/docs/serialization.md +18 -13
- data/ext/prism/api_node.c +411 -240
- data/ext/prism/extconf.rb +97 -127
- data/ext/prism/extension.c +97 -33
- data/ext/prism/extension.h +1 -1
- data/include/prism/ast.h +377 -159
- data/include/prism/defines.h +17 -0
- data/include/prism/diagnostic.h +38 -6
- data/include/prism/{enc/pm_encoding.h → encoding.h} +126 -64
- data/include/prism/options.h +2 -2
- data/include/prism/parser.h +62 -36
- data/include/prism/regexp.h +2 -2
- data/include/prism/util/pm_buffer.h +9 -1
- data/include/prism/util/pm_memchr.h +2 -2
- data/include/prism/util/pm_strpbrk.h +3 -3
- data/include/prism/version.h +3 -3
- data/include/prism.h +13 -15
- data/lib/prism/compiler.rb +15 -3
- data/lib/prism/debug.rb +13 -4
- data/lib/prism/desugar_compiler.rb +4 -3
- data/lib/prism/dispatcher.rb +70 -14
- data/lib/prism/dot_visitor.rb +4612 -0
- data/lib/prism/dsl.rb +77 -57
- data/lib/prism/ffi.rb +19 -6
- data/lib/prism/lex_compat.rb +19 -9
- data/lib/prism/mutation_compiler.rb +26 -6
- data/lib/prism/node.rb +1314 -522
- data/lib/prism/node_ext.rb +102 -19
- data/lib/prism/parse_result.rb +58 -27
- data/lib/prism/ripper_compat.rb +49 -34
- data/lib/prism/serialize.rb +251 -227
- data/lib/prism/visitor.rb +15 -3
- data/lib/prism.rb +21 -4
- data/prism.gemspec +7 -9
- data/rbi/prism.rbi +688 -284
- data/rbi/prism_static.rbi +3 -0
- data/sig/prism.rbs +426 -156
- data/sig/prism_static.rbs +1 -0
- data/src/diagnostic.c +280 -216
- data/src/encoding.c +5137 -0
- data/src/node.c +99 -21
- data/src/options.c +21 -2
- data/src/prettyprint.c +1743 -1241
- data/src/prism.c +1774 -831
- data/src/regexp.c +15 -15
- data/src/serialize.c +261 -164
- data/src/util/pm_buffer.c +10 -1
- data/src/util/pm_memchr.c +1 -1
- data/src/util/pm_strpbrk.c +4 -4
- metadata +8 -10
- data/src/enc/pm_big5.c +0 -53
- data/src/enc/pm_euc_jp.c +0 -59
- data/src/enc/pm_gbk.c +0 -62
- data/src/enc/pm_shift_jis.c +0 -57
- data/src/enc/pm_tables.c +0 -743
- data/src/enc/pm_unicode.c +0 -2369
- data/src/enc/pm_windows_31j.c +0 -57
data/sig/prism.rbs
CHANGED
@@ -100,10 +100,10 @@ module Prism
|
|
100
100
|
# return foo, bar, baz
|
101
101
|
# ^^^^^^^^^^^^^
|
102
102
|
class ArgumentsNode < Node
|
103
|
-
attr_reader arguments: Array[Node]
|
104
103
|
attr_reader flags: Integer
|
104
|
+
attr_reader arguments: Array[Node]
|
105
105
|
|
106
|
-
def initialize: (arguments: Array[Node],
|
106
|
+
def initialize: (flags: Integer, arguments: Array[Node], location: Location) -> void
|
107
107
|
def accept: (visitor: Visitor) -> void
|
108
108
|
def set_newline_flag: (newline_marked: Array[bool]) -> void
|
109
109
|
def child_nodes: () -> Array[Node?]
|
@@ -113,7 +113,7 @@ module Prism
|
|
113
113
|
|
114
114
|
def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, (Node | Array[Node] | String | Token | Array[Token] | Location)?]
|
115
115
|
|
116
|
-
def
|
116
|
+
def contains_keyword_splat?: () -> bool
|
117
117
|
|
118
118
|
def inspect: (inspector: NodeInspector) -> String
|
119
119
|
end
|
@@ -123,11 +123,12 @@ module Prism
|
|
123
123
|
# [1, 2, 3]
|
124
124
|
# ^^^^^^^^^
|
125
125
|
class ArrayNode < Node
|
126
|
+
attr_reader flags: Integer
|
126
127
|
attr_reader elements: Array[Node]
|
127
128
|
attr_reader opening_loc: Location?
|
128
129
|
attr_reader closing_loc: Location?
|
129
130
|
|
130
|
-
def initialize: (elements: Array[Node], opening_loc: Location?, closing_loc: Location?, location: Location) -> void
|
131
|
+
def initialize: (flags: Integer, elements: Array[Node], opening_loc: Location?, closing_loc: Location?, location: Location) -> void
|
131
132
|
def accept: (visitor: Visitor) -> void
|
132
133
|
def set_newline_flag: (newline_marked: Array[bool]) -> void
|
133
134
|
def child_nodes: () -> Array[Node?]
|
@@ -137,6 +138,8 @@ module Prism
|
|
137
138
|
|
138
139
|
def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, (Node | Array[Node] | String | Token | Array[Token] | Location)?]
|
139
140
|
|
141
|
+
def contains_splat?: () -> bool
|
142
|
+
|
140
143
|
def opening: () -> String?
|
141
144
|
|
142
145
|
def closing: () -> String?
|
@@ -324,12 +327,13 @@ module Prism
|
|
324
327
|
# ^^^^^^^^^^^^^^
|
325
328
|
class BlockNode < Node
|
326
329
|
attr_reader locals: Array[Symbol]
|
327
|
-
attr_reader
|
330
|
+
attr_reader locals_body_index: Integer
|
331
|
+
attr_reader parameters: Node?
|
328
332
|
attr_reader body: Node?
|
329
333
|
attr_reader opening_loc: Location
|
330
334
|
attr_reader closing_loc: Location
|
331
335
|
|
332
|
-
def initialize: (locals: Array[Symbol], parameters:
|
336
|
+
def initialize: (locals: Array[Symbol], locals_body_index: Integer, parameters: Node?, body: Node?, opening_loc: Location, closing_loc: Location, location: Location) -> void
|
333
337
|
def accept: (visitor: Visitor) -> void
|
334
338
|
def set_newline_flag: (newline_marked: Array[bool]) -> void
|
335
339
|
def child_nodes: () -> Array[Node?]
|
@@ -426,16 +430,16 @@ module Prism
|
|
426
430
|
# foo.bar &&= value
|
427
431
|
# ^^^^^^^^^^^^^^^^^
|
428
432
|
class CallAndWriteNode < Node
|
433
|
+
attr_reader flags: Integer
|
429
434
|
attr_reader receiver: Node?
|
430
435
|
attr_reader call_operator_loc: Location?
|
431
436
|
attr_reader message_loc: Location?
|
432
|
-
attr_reader flags: Integer
|
433
437
|
attr_reader read_name: Symbol
|
434
438
|
attr_reader write_name: Symbol
|
435
439
|
attr_reader operator_loc: Location
|
436
440
|
attr_reader value: Node
|
437
441
|
|
438
|
-
def initialize: (receiver: Node?, call_operator_loc: Location?, message_loc: Location?,
|
442
|
+
def initialize: (flags: Integer, receiver: Node?, call_operator_loc: Location?, message_loc: Location?, read_name: Symbol, write_name: Symbol, operator_loc: Location, value: Node, location: Location) -> void
|
439
443
|
def accept: (visitor: Visitor) -> void
|
440
444
|
def set_newline_flag: (newline_marked: Array[bool]) -> void
|
441
445
|
def child_nodes: () -> Array[Node?]
|
@@ -445,14 +449,16 @@ module Prism
|
|
445
449
|
|
446
450
|
def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, (Node | Array[Node] | String | Token | Array[Token] | Location)?]
|
447
451
|
|
448
|
-
def call_operator: () -> String?
|
449
|
-
|
450
|
-
def message: () -> String?
|
451
|
-
|
452
452
|
def safe_navigation?: () -> bool
|
453
453
|
|
454
454
|
def variable_call?: () -> bool
|
455
455
|
|
456
|
+
def attribute_write?: () -> bool
|
457
|
+
|
458
|
+
def call_operator: () -> String?
|
459
|
+
|
460
|
+
def message: () -> String?
|
461
|
+
|
456
462
|
def operator: () -> String
|
457
463
|
|
458
464
|
def inspect: (inspector: NodeInspector) -> String
|
@@ -477,17 +483,17 @@ module Prism
|
|
477
483
|
# foo&.bar
|
478
484
|
# ^^^^^^^^
|
479
485
|
class CallNode < Node
|
486
|
+
attr_reader flags: Integer
|
480
487
|
attr_reader receiver: Node?
|
481
488
|
attr_reader call_operator_loc: Location?
|
489
|
+
attr_reader name: Symbol
|
482
490
|
attr_reader message_loc: Location?
|
483
491
|
attr_reader opening_loc: Location?
|
484
492
|
attr_reader arguments: ArgumentsNode?
|
485
493
|
attr_reader closing_loc: Location?
|
486
494
|
attr_reader block: Node?
|
487
|
-
attr_reader flags: Integer
|
488
|
-
attr_reader name: Symbol
|
489
495
|
|
490
|
-
def initialize: (receiver: Node?, call_operator_loc: Location?, message_loc: Location?, opening_loc: Location?, arguments: ArgumentsNode?, closing_loc: Location?, block: Node?,
|
496
|
+
def initialize: (flags: Integer, receiver: Node?, call_operator_loc: Location?, name: Symbol, message_loc: Location?, opening_loc: Location?, arguments: ArgumentsNode?, closing_loc: Location?, block: Node?, location: Location) -> void
|
491
497
|
def accept: (visitor: Visitor) -> void
|
492
498
|
def set_newline_flag: (newline_marked: Array[bool]) -> void
|
493
499
|
def child_nodes: () -> Array[Node?]
|
@@ -497,6 +503,12 @@ module Prism
|
|
497
503
|
|
498
504
|
def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, (Node | Array[Node] | String | Token | Array[Token] | Location)?]
|
499
505
|
|
506
|
+
def safe_navigation?: () -> bool
|
507
|
+
|
508
|
+
def variable_call?: () -> bool
|
509
|
+
|
510
|
+
def attribute_write?: () -> bool
|
511
|
+
|
500
512
|
def call_operator: () -> String?
|
501
513
|
|
502
514
|
def message: () -> String?
|
@@ -505,10 +517,6 @@ module Prism
|
|
505
517
|
|
506
518
|
def closing: () -> String?
|
507
519
|
|
508
|
-
def safe_navigation?: () -> bool
|
509
|
-
|
510
|
-
def variable_call?: () -> bool
|
511
|
-
|
512
520
|
def inspect: (inspector: NodeInspector) -> String
|
513
521
|
end
|
514
522
|
# Represents the use of an assignment operator on a call.
|
@@ -516,17 +524,17 @@ module Prism
|
|
516
524
|
# foo.bar += baz
|
517
525
|
# ^^^^^^^^^^^^^^
|
518
526
|
class CallOperatorWriteNode < Node
|
527
|
+
attr_reader flags: Integer
|
519
528
|
attr_reader receiver: Node?
|
520
529
|
attr_reader call_operator_loc: Location?
|
521
530
|
attr_reader message_loc: Location?
|
522
|
-
attr_reader flags: Integer
|
523
531
|
attr_reader read_name: Symbol
|
524
532
|
attr_reader write_name: Symbol
|
525
533
|
attr_reader operator: Symbol
|
526
534
|
attr_reader operator_loc: Location
|
527
535
|
attr_reader value: Node
|
528
536
|
|
529
|
-
def initialize: (receiver: Node?, call_operator_loc: Location?, message_loc: Location?,
|
537
|
+
def initialize: (flags: Integer, receiver: Node?, call_operator_loc: Location?, message_loc: Location?, read_name: Symbol, write_name: Symbol, operator: Symbol, operator_loc: Location, value: Node, location: Location) -> void
|
530
538
|
def accept: (visitor: Visitor) -> void
|
531
539
|
def set_newline_flag: (newline_marked: Array[bool]) -> void
|
532
540
|
def child_nodes: () -> Array[Node?]
|
@@ -536,14 +544,16 @@ module Prism
|
|
536
544
|
|
537
545
|
def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, (Node | Array[Node] | String | Token | Array[Token] | Location)?]
|
538
546
|
|
539
|
-
def call_operator: () -> String?
|
540
|
-
|
541
|
-
def message: () -> String?
|
542
|
-
|
543
547
|
def safe_navigation?: () -> bool
|
544
548
|
|
545
549
|
def variable_call?: () -> bool
|
546
550
|
|
551
|
+
def attribute_write?: () -> bool
|
552
|
+
|
553
|
+
def call_operator: () -> String?
|
554
|
+
|
555
|
+
def message: () -> String?
|
556
|
+
|
547
557
|
def inspect: (inspector: NodeInspector) -> String
|
548
558
|
end
|
549
559
|
# Represents the use of the `||=` operator on a call.
|
@@ -551,16 +561,16 @@ module Prism
|
|
551
561
|
# foo.bar ||= value
|
552
562
|
# ^^^^^^^^^^^^^^^^^
|
553
563
|
class CallOrWriteNode < Node
|
564
|
+
attr_reader flags: Integer
|
554
565
|
attr_reader receiver: Node?
|
555
566
|
attr_reader call_operator_loc: Location?
|
556
567
|
attr_reader message_loc: Location?
|
557
|
-
attr_reader flags: Integer
|
558
568
|
attr_reader read_name: Symbol
|
559
569
|
attr_reader write_name: Symbol
|
560
570
|
attr_reader operator_loc: Location
|
561
571
|
attr_reader value: Node
|
562
572
|
|
563
|
-
def initialize: (receiver: Node?, call_operator_loc: Location?, message_loc: Location?,
|
573
|
+
def initialize: (flags: Integer, receiver: Node?, call_operator_loc: Location?, message_loc: Location?, read_name: Symbol, write_name: Symbol, operator_loc: Location, value: Node, location: Location) -> void
|
564
574
|
def accept: (visitor: Visitor) -> void
|
565
575
|
def set_newline_flag: (newline_marked: Array[bool]) -> void
|
566
576
|
def child_nodes: () -> Array[Node?]
|
@@ -570,15 +580,58 @@ module Prism
|
|
570
580
|
|
571
581
|
def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, (Node | Array[Node] | String | Token | Array[Token] | Location)?]
|
572
582
|
|
583
|
+
def safe_navigation?: () -> bool
|
584
|
+
|
585
|
+
def variable_call?: () -> bool
|
586
|
+
|
587
|
+
def attribute_write?: () -> bool
|
588
|
+
|
573
589
|
def call_operator: () -> String?
|
574
590
|
|
575
591
|
def message: () -> String?
|
576
592
|
|
593
|
+
def operator: () -> String
|
594
|
+
|
595
|
+
def inspect: (inspector: NodeInspector) -> String
|
596
|
+
end
|
597
|
+
# Represents assigning to a method call.
|
598
|
+
#
|
599
|
+
# foo.bar, = 1
|
600
|
+
# ^^^^^^^
|
601
|
+
#
|
602
|
+
# begin
|
603
|
+
# rescue => foo.bar
|
604
|
+
# ^^^^^^^
|
605
|
+
# end
|
606
|
+
#
|
607
|
+
# for foo.bar in baz do end
|
608
|
+
# ^^^^^^^
|
609
|
+
class CallTargetNode < Node
|
610
|
+
attr_reader flags: Integer
|
611
|
+
attr_reader receiver: Node
|
612
|
+
attr_reader call_operator_loc: Location
|
613
|
+
attr_reader name: Symbol
|
614
|
+
attr_reader message_loc: Location
|
615
|
+
|
616
|
+
def initialize: (flags: Integer, receiver: Node, call_operator_loc: Location, name: Symbol, message_loc: Location, location: Location) -> void
|
617
|
+
def accept: (visitor: Visitor) -> void
|
618
|
+
def set_newline_flag: (newline_marked: Array[bool]) -> void
|
619
|
+
def child_nodes: () -> Array[Node?]
|
620
|
+
def deconstruct: () -> Array[Node?]
|
621
|
+
|
622
|
+
def copy: (**untyped) -> CallTargetNode
|
623
|
+
|
624
|
+
def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, (Node | Array[Node] | String | Token | Array[Token] | Location)?]
|
625
|
+
|
577
626
|
def safe_navigation?: () -> bool
|
578
627
|
|
579
628
|
def variable_call?: () -> bool
|
580
629
|
|
581
|
-
def
|
630
|
+
def attribute_write?: () -> bool
|
631
|
+
|
632
|
+
def call_operator: () -> String
|
633
|
+
|
634
|
+
def message: () -> String
|
582
635
|
|
583
636
|
def inspect: (inspector: NodeInspector) -> String
|
584
637
|
end
|
@@ -605,6 +658,35 @@ module Prism
|
|
605
658
|
|
606
659
|
def inspect: (inspector: NodeInspector) -> String
|
607
660
|
end
|
661
|
+
# Represents the use of a case statement for pattern matching.
|
662
|
+
#
|
663
|
+
# case true
|
664
|
+
# in false
|
665
|
+
# end
|
666
|
+
# ^^^^^^^^^
|
667
|
+
class CaseMatchNode < Node
|
668
|
+
attr_reader predicate: Node?
|
669
|
+
attr_reader conditions: Array[Node]
|
670
|
+
attr_reader consequent: ElseNode?
|
671
|
+
attr_reader case_keyword_loc: Location
|
672
|
+
attr_reader end_keyword_loc: Location
|
673
|
+
|
674
|
+
def initialize: (predicate: Node?, conditions: Array[Node], consequent: ElseNode?, case_keyword_loc: Location, end_keyword_loc: Location, location: Location) -> void
|
675
|
+
def accept: (visitor: Visitor) -> void
|
676
|
+
def set_newline_flag: (newline_marked: Array[bool]) -> void
|
677
|
+
def child_nodes: () -> Array[Node?]
|
678
|
+
def deconstruct: () -> Array[Node?]
|
679
|
+
|
680
|
+
def copy: (**untyped) -> CaseMatchNode
|
681
|
+
|
682
|
+
def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, (Node | Array[Node] | String | Token | Array[Token] | Location)?]
|
683
|
+
|
684
|
+
def case_keyword: () -> String
|
685
|
+
|
686
|
+
def end_keyword: () -> String
|
687
|
+
|
688
|
+
def inspect: (inspector: NodeInspector) -> String
|
689
|
+
end
|
608
690
|
# Represents the use of a case statement.
|
609
691
|
#
|
610
692
|
# case true
|
@@ -1087,6 +1169,7 @@ module Prism
|
|
1087
1169
|
attr_reader parameters: ParametersNode?
|
1088
1170
|
attr_reader body: Node?
|
1089
1171
|
attr_reader locals: Array[Symbol]
|
1172
|
+
attr_reader locals_body_index: Integer
|
1090
1173
|
attr_reader def_keyword_loc: Location
|
1091
1174
|
attr_reader operator_loc: Location?
|
1092
1175
|
attr_reader lparen_loc: Location?
|
@@ -1094,7 +1177,7 @@ module Prism
|
|
1094
1177
|
attr_reader equal_loc: Location?
|
1095
1178
|
attr_reader end_keyword_loc: Location?
|
1096
1179
|
|
1097
|
-
def initialize: (name: Symbol, name_loc: Location, receiver: Node?, parameters: ParametersNode?, body: Node?, locals: Array[Symbol], def_keyword_loc: Location, operator_loc: Location?, lparen_loc: Location?, rparen_loc: Location?, equal_loc: Location?, end_keyword_loc: Location?, location: Location) -> void
|
1180
|
+
def initialize: (name: Symbol, name_loc: Location, receiver: Node?, parameters: ParametersNode?, body: Node?, locals: Array[Symbol], locals_body_index: Integer, def_keyword_loc: Location, operator_loc: Location?, lparen_loc: Location?, rparen_loc: Location?, equal_loc: Location?, end_keyword_loc: Location?, location: Location) -> void
|
1098
1181
|
def accept: (visitor: Visitor) -> void
|
1099
1182
|
def set_newline_flag: (newline_marked: Array[bool]) -> void
|
1100
1183
|
def child_nodes: () -> Array[Node?]
|
@@ -1304,12 +1387,12 @@ module Prism
|
|
1304
1387
|
# baz if foo .. bar
|
1305
1388
|
# ^^^^^^^^^^
|
1306
1389
|
class FlipFlopNode < Node
|
1390
|
+
attr_reader flags: Integer
|
1307
1391
|
attr_reader left: Node?
|
1308
1392
|
attr_reader right: Node?
|
1309
1393
|
attr_reader operator_loc: Location
|
1310
|
-
attr_reader flags: Integer
|
1311
1394
|
|
1312
|
-
def initialize: (left: Node?, right: Node?, operator_loc: Location,
|
1395
|
+
def initialize: (flags: Integer, left: Node?, right: Node?, operator_loc: Location, location: Location) -> void
|
1313
1396
|
def accept: (visitor: Visitor) -> void
|
1314
1397
|
def set_newline_flag: (newline_marked: Array[bool]) -> void
|
1315
1398
|
def child_nodes: () -> Array[Node?]
|
@@ -1319,10 +1402,10 @@ module Prism
|
|
1319
1402
|
|
1320
1403
|
def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, (Node | Array[Node] | String | Token | Array[Token] | Location)?]
|
1321
1404
|
|
1322
|
-
def operator: () -> String
|
1323
|
-
|
1324
1405
|
def exclude_end?: () -> bool
|
1325
1406
|
|
1407
|
+
def operator: () -> String
|
1408
|
+
|
1326
1409
|
def inspect: (inspector: NodeInspector) -> String
|
1327
1410
|
end
|
1328
1411
|
# Represents a floating point number literal.
|
@@ -1632,11 +1715,12 @@ module Prism
|
|
1632
1715
|
class IfNode < Node
|
1633
1716
|
attr_reader if_keyword_loc: Location?
|
1634
1717
|
attr_reader predicate: Node
|
1718
|
+
attr_reader then_keyword_loc: Location?
|
1635
1719
|
attr_reader statements: StatementsNode?
|
1636
1720
|
attr_reader consequent: Node?
|
1637
1721
|
attr_reader end_keyword_loc: Location?
|
1638
1722
|
|
1639
|
-
def initialize: (if_keyword_loc: Location?, predicate: Node, statements: StatementsNode?, consequent: Node?, end_keyword_loc: Location?, location: Location) -> void
|
1723
|
+
def initialize: (if_keyword_loc: Location?, predicate: Node, then_keyword_loc: Location?, statements: StatementsNode?, consequent: Node?, end_keyword_loc: Location?, location: Location) -> void
|
1640
1724
|
def accept: (visitor: Visitor) -> void
|
1641
1725
|
def set_newline_flag: (newline_marked: Array[bool]) -> void
|
1642
1726
|
def child_nodes: () -> Array[Node?]
|
@@ -1648,6 +1732,8 @@ module Prism
|
|
1648
1732
|
|
1649
1733
|
def if_keyword: () -> String?
|
1650
1734
|
|
1735
|
+
def then_keyword: () -> String?
|
1736
|
+
|
1651
1737
|
def end_keyword: () -> String?
|
1652
1738
|
|
1653
1739
|
def inspect: (inspector: NodeInspector) -> String
|
@@ -1694,6 +1780,33 @@ module Prism
|
|
1694
1780
|
|
1695
1781
|
def inspect: (inspector: NodeInspector) -> String
|
1696
1782
|
end
|
1783
|
+
# Represents using a trailing comma to indicate an implicit rest parameter.
|
1784
|
+
#
|
1785
|
+
# foo { |bar,| }
|
1786
|
+
# ^
|
1787
|
+
#
|
1788
|
+
# foo in [bar,]
|
1789
|
+
# ^
|
1790
|
+
#
|
1791
|
+
# for foo, in bar do end
|
1792
|
+
# ^
|
1793
|
+
#
|
1794
|
+
# foo, = bar
|
1795
|
+
# ^
|
1796
|
+
class ImplicitRestNode < Node
|
1797
|
+
|
1798
|
+
def initialize: (location: Location) -> void
|
1799
|
+
def accept: (visitor: Visitor) -> void
|
1800
|
+
def set_newline_flag: (newline_marked: Array[bool]) -> void
|
1801
|
+
def child_nodes: () -> Array[Node?]
|
1802
|
+
def deconstruct: () -> Array[Node?]
|
1803
|
+
|
1804
|
+
def copy: (**untyped) -> ImplicitRestNode
|
1805
|
+
|
1806
|
+
def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, (Node | Array[Node] | String | Token | Array[Token] | Location)?]
|
1807
|
+
|
1808
|
+
def inspect: (inspector: NodeInspector) -> String
|
1809
|
+
end
|
1697
1810
|
# Represents the use of the `in` keyword in a case statement.
|
1698
1811
|
#
|
1699
1812
|
# case a; in b then c end
|
@@ -1725,17 +1838,17 @@ module Prism
|
|
1725
1838
|
# foo.bar[baz] &&= value
|
1726
1839
|
# ^^^^^^^^^^^^^^^^^^^^^^
|
1727
1840
|
class IndexAndWriteNode < Node
|
1841
|
+
attr_reader flags: Integer
|
1728
1842
|
attr_reader receiver: Node?
|
1729
1843
|
attr_reader call_operator_loc: Location?
|
1730
1844
|
attr_reader opening_loc: Location
|
1731
1845
|
attr_reader arguments: ArgumentsNode?
|
1732
1846
|
attr_reader closing_loc: Location
|
1733
1847
|
attr_reader block: Node?
|
1734
|
-
attr_reader flags: Integer
|
1735
1848
|
attr_reader operator_loc: Location
|
1736
1849
|
attr_reader value: Node
|
1737
1850
|
|
1738
|
-
def initialize: (receiver: Node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Node?,
|
1851
|
+
def initialize: (flags: Integer, receiver: Node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Node?, operator_loc: Location, value: Node, location: Location) -> void
|
1739
1852
|
def accept: (visitor: Visitor) -> void
|
1740
1853
|
def set_newline_flag: (newline_marked: Array[bool]) -> void
|
1741
1854
|
def child_nodes: () -> Array[Node?]
|
@@ -1745,16 +1858,18 @@ module Prism
|
|
1745
1858
|
|
1746
1859
|
def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, (Node | Array[Node] | String | Token | Array[Token] | Location)?]
|
1747
1860
|
|
1861
|
+
def safe_navigation?: () -> bool
|
1862
|
+
|
1863
|
+
def variable_call?: () -> bool
|
1864
|
+
|
1865
|
+
def attribute_write?: () -> bool
|
1866
|
+
|
1748
1867
|
def call_operator: () -> String?
|
1749
1868
|
|
1750
1869
|
def opening: () -> String
|
1751
1870
|
|
1752
1871
|
def closing: () -> String
|
1753
1872
|
|
1754
|
-
def safe_navigation?: () -> bool
|
1755
|
-
|
1756
|
-
def variable_call?: () -> bool
|
1757
|
-
|
1758
1873
|
def operator: () -> String
|
1759
1874
|
|
1760
1875
|
def inspect: (inspector: NodeInspector) -> String
|
@@ -1764,18 +1879,18 @@ module Prism
|
|
1764
1879
|
# foo.bar[baz] += value
|
1765
1880
|
# ^^^^^^^^^^^^^^^^^^^^^
|
1766
1881
|
class IndexOperatorWriteNode < Node
|
1882
|
+
attr_reader flags: Integer
|
1767
1883
|
attr_reader receiver: Node?
|
1768
1884
|
attr_reader call_operator_loc: Location?
|
1769
1885
|
attr_reader opening_loc: Location
|
1770
1886
|
attr_reader arguments: ArgumentsNode?
|
1771
1887
|
attr_reader closing_loc: Location
|
1772
1888
|
attr_reader block: Node?
|
1773
|
-
attr_reader flags: Integer
|
1774
1889
|
attr_reader operator: Symbol
|
1775
1890
|
attr_reader operator_loc: Location
|
1776
1891
|
attr_reader value: Node
|
1777
1892
|
|
1778
|
-
def initialize: (receiver: Node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Node?,
|
1893
|
+
def initialize: (flags: Integer, receiver: Node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Node?, operator: Symbol, operator_loc: Location, value: Node, location: Location) -> void
|
1779
1894
|
def accept: (visitor: Visitor) -> void
|
1780
1895
|
def set_newline_flag: (newline_marked: Array[bool]) -> void
|
1781
1896
|
def child_nodes: () -> Array[Node?]
|
@@ -1785,16 +1900,18 @@ module Prism
|
|
1785
1900
|
|
1786
1901
|
def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, (Node | Array[Node] | String | Token | Array[Token] | Location)?]
|
1787
1902
|
|
1903
|
+
def safe_navigation?: () -> bool
|
1904
|
+
|
1905
|
+
def variable_call?: () -> bool
|
1906
|
+
|
1907
|
+
def attribute_write?: () -> bool
|
1908
|
+
|
1788
1909
|
def call_operator: () -> String?
|
1789
1910
|
|
1790
1911
|
def opening: () -> String
|
1791
1912
|
|
1792
1913
|
def closing: () -> String
|
1793
1914
|
|
1794
|
-
def safe_navigation?: () -> bool
|
1795
|
-
|
1796
|
-
def variable_call?: () -> bool
|
1797
|
-
|
1798
1915
|
def inspect: (inspector: NodeInspector) -> String
|
1799
1916
|
end
|
1800
1917
|
# Represents the use of the `||=` operator on a call to `[]`.
|
@@ -1802,17 +1919,17 @@ module Prism
|
|
1802
1919
|
# foo.bar[baz] ||= value
|
1803
1920
|
# ^^^^^^^^^^^^^^^^^^^^^^
|
1804
1921
|
class IndexOrWriteNode < Node
|
1922
|
+
attr_reader flags: Integer
|
1805
1923
|
attr_reader receiver: Node?
|
1806
1924
|
attr_reader call_operator_loc: Location?
|
1807
1925
|
attr_reader opening_loc: Location
|
1808
1926
|
attr_reader arguments: ArgumentsNode?
|
1809
1927
|
attr_reader closing_loc: Location
|
1810
1928
|
attr_reader block: Node?
|
1811
|
-
attr_reader flags: Integer
|
1812
1929
|
attr_reader operator_loc: Location
|
1813
1930
|
attr_reader value: Node
|
1814
1931
|
|
1815
|
-
def initialize: (receiver: Node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Node?,
|
1932
|
+
def initialize: (flags: Integer, receiver: Node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Node?, operator_loc: Location, value: Node, location: Location) -> void
|
1816
1933
|
def accept: (visitor: Visitor) -> void
|
1817
1934
|
def set_newline_flag: (newline_marked: Array[bool]) -> void
|
1818
1935
|
def child_nodes: () -> Array[Node?]
|
@@ -1822,17 +1939,61 @@ module Prism
|
|
1822
1939
|
|
1823
1940
|
def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, (Node | Array[Node] | String | Token | Array[Token] | Location)?]
|
1824
1941
|
|
1942
|
+
def safe_navigation?: () -> bool
|
1943
|
+
|
1944
|
+
def variable_call?: () -> bool
|
1945
|
+
|
1946
|
+
def attribute_write?: () -> bool
|
1947
|
+
|
1825
1948
|
def call_operator: () -> String?
|
1826
1949
|
|
1827
1950
|
def opening: () -> String
|
1828
1951
|
|
1829
1952
|
def closing: () -> String
|
1830
1953
|
|
1954
|
+
def operator: () -> String
|
1955
|
+
|
1956
|
+
def inspect: (inspector: NodeInspector) -> String
|
1957
|
+
end
|
1958
|
+
# Represents assigning to an index.
|
1959
|
+
#
|
1960
|
+
# foo[bar], = 1
|
1961
|
+
# ^^^^^^^^
|
1962
|
+
#
|
1963
|
+
# begin
|
1964
|
+
# rescue => foo[bar]
|
1965
|
+
# ^^^^^^^^
|
1966
|
+
# end
|
1967
|
+
#
|
1968
|
+
# for foo[bar] in baz do end
|
1969
|
+
# ^^^^^^^^
|
1970
|
+
class IndexTargetNode < Node
|
1971
|
+
attr_reader flags: Integer
|
1972
|
+
attr_reader receiver: Node
|
1973
|
+
attr_reader opening_loc: Location
|
1974
|
+
attr_reader arguments: ArgumentsNode?
|
1975
|
+
attr_reader closing_loc: Location
|
1976
|
+
attr_reader block: Node?
|
1977
|
+
|
1978
|
+
def initialize: (flags: Integer, receiver: Node, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Node?, location: Location) -> void
|
1979
|
+
def accept: (visitor: Visitor) -> void
|
1980
|
+
def set_newline_flag: (newline_marked: Array[bool]) -> void
|
1981
|
+
def child_nodes: () -> Array[Node?]
|
1982
|
+
def deconstruct: () -> Array[Node?]
|
1983
|
+
|
1984
|
+
def copy: (**untyped) -> IndexTargetNode
|
1985
|
+
|
1986
|
+
def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, (Node | Array[Node] | String | Token | Array[Token] | Location)?]
|
1987
|
+
|
1831
1988
|
def safe_navigation?: () -> bool
|
1832
1989
|
|
1833
1990
|
def variable_call?: () -> bool
|
1834
1991
|
|
1835
|
-
def
|
1992
|
+
def attribute_write?: () -> bool
|
1993
|
+
|
1994
|
+
def opening: () -> String
|
1995
|
+
|
1996
|
+
def closing: () -> String
|
1836
1997
|
|
1837
1998
|
def inspect: (inspector: NodeInspector) -> String
|
1838
1999
|
end
|
@@ -1988,10 +2149,10 @@ module Prism
|
|
1988
2149
|
|
1989
2150
|
def binary?: () -> bool
|
1990
2151
|
|
1991
|
-
def octal?: () -> bool
|
1992
|
-
|
1993
2152
|
def decimal?: () -> bool
|
1994
2153
|
|
2154
|
+
def octal?: () -> bool
|
2155
|
+
|
1995
2156
|
def hexadecimal?: () -> bool
|
1996
2157
|
|
1997
2158
|
def inspect: (inspector: NodeInspector) -> String
|
@@ -2003,12 +2164,12 @@ module Prism
|
|
2003
2164
|
# if /foo #{bar} baz/ then end
|
2004
2165
|
# ^^^^^^^^^^^^^^^^
|
2005
2166
|
class InterpolatedMatchLastLineNode < Node
|
2167
|
+
attr_reader flags: Integer
|
2006
2168
|
attr_reader opening_loc: Location
|
2007
2169
|
attr_reader parts: Array[Node]
|
2008
2170
|
attr_reader closing_loc: Location
|
2009
|
-
attr_reader flags: Integer
|
2010
2171
|
|
2011
|
-
def initialize: (opening_loc: Location, parts: Array[Node], closing_loc: Location,
|
2172
|
+
def initialize: (flags: Integer, opening_loc: Location, parts: Array[Node], closing_loc: Location, location: Location) -> void
|
2012
2173
|
def accept: (visitor: Visitor) -> void
|
2013
2174
|
def set_newline_flag: (newline_marked: Array[bool]) -> void
|
2014
2175
|
def child_nodes: () -> Array[Node?]
|
@@ -2018,10 +2179,6 @@ module Prism
|
|
2018
2179
|
|
2019
2180
|
def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, (Node | Array[Node] | String | Token | Array[Token] | Location)?]
|
2020
2181
|
|
2021
|
-
def opening: () -> String
|
2022
|
-
|
2023
|
-
def closing: () -> String
|
2024
|
-
|
2025
2182
|
def ignore_case?: () -> bool
|
2026
2183
|
|
2027
2184
|
def extended?: () -> bool
|
@@ -2038,6 +2195,16 @@ module Prism
|
|
2038
2195
|
|
2039
2196
|
def utf_8?: () -> bool
|
2040
2197
|
|
2198
|
+
def forced_utf8_encoding?: () -> bool
|
2199
|
+
|
2200
|
+
def forced_binary_encoding?: () -> bool
|
2201
|
+
|
2202
|
+
def forced_us_ascii_encoding?: () -> bool
|
2203
|
+
|
2204
|
+
def opening: () -> String
|
2205
|
+
|
2206
|
+
def closing: () -> String
|
2207
|
+
|
2041
2208
|
def inspect: (inspector: NodeInspector) -> String
|
2042
2209
|
end
|
2043
2210
|
# Represents a regular expression literal that contains interpolation.
|
@@ -2045,12 +2212,12 @@ module Prism
|
|
2045
2212
|
# /foo #{bar} baz/
|
2046
2213
|
# ^^^^^^^^^^^^^^^^
|
2047
2214
|
class InterpolatedRegularExpressionNode < Node
|
2215
|
+
attr_reader flags: Integer
|
2048
2216
|
attr_reader opening_loc: Location
|
2049
2217
|
attr_reader parts: Array[Node]
|
2050
2218
|
attr_reader closing_loc: Location
|
2051
|
-
attr_reader flags: Integer
|
2052
2219
|
|
2053
|
-
def initialize: (opening_loc: Location, parts: Array[Node], closing_loc: Location,
|
2220
|
+
def initialize: (flags: Integer, opening_loc: Location, parts: Array[Node], closing_loc: Location, location: Location) -> void
|
2054
2221
|
def accept: (visitor: Visitor) -> void
|
2055
2222
|
def set_newline_flag: (newline_marked: Array[bool]) -> void
|
2056
2223
|
def child_nodes: () -> Array[Node?]
|
@@ -2060,10 +2227,6 @@ module Prism
|
|
2060
2227
|
|
2061
2228
|
def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, (Node | Array[Node] | String | Token | Array[Token] | Location)?]
|
2062
2229
|
|
2063
|
-
def opening: () -> String
|
2064
|
-
|
2065
|
-
def closing: () -> String
|
2066
|
-
|
2067
2230
|
def ignore_case?: () -> bool
|
2068
2231
|
|
2069
2232
|
def extended?: () -> bool
|
@@ -2080,6 +2243,16 @@ module Prism
|
|
2080
2243
|
|
2081
2244
|
def utf_8?: () -> bool
|
2082
2245
|
|
2246
|
+
def forced_utf8_encoding?: () -> bool
|
2247
|
+
|
2248
|
+
def forced_binary_encoding?: () -> bool
|
2249
|
+
|
2250
|
+
def forced_us_ascii_encoding?: () -> bool
|
2251
|
+
|
2252
|
+
def opening: () -> String
|
2253
|
+
|
2254
|
+
def closing: () -> String
|
2255
|
+
|
2083
2256
|
def inspect: (inspector: NodeInspector) -> String
|
2084
2257
|
end
|
2085
2258
|
# Represents a string literal that contains interpolation.
|
@@ -2162,9 +2335,10 @@ module Prism
|
|
2162
2335
|
# foo(a: b)
|
2163
2336
|
# ^^^^
|
2164
2337
|
class KeywordHashNode < Node
|
2338
|
+
attr_reader flags: Integer
|
2165
2339
|
attr_reader elements: Array[Node]
|
2166
2340
|
|
2167
|
-
def initialize: (elements: Array[Node], location: Location) -> void
|
2341
|
+
def initialize: (flags: Integer, elements: Array[Node], location: Location) -> void
|
2168
2342
|
def accept: (visitor: Visitor) -> void
|
2169
2343
|
def set_newline_flag: (newline_marked: Array[bool]) -> void
|
2170
2344
|
def child_nodes: () -> Array[Node?]
|
@@ -2174,6 +2348,8 @@ module Prism
|
|
2174
2348
|
|
2175
2349
|
def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, (Node | Array[Node] | String | Token | Array[Token] | Location)?]
|
2176
2350
|
|
2351
|
+
def static_keys?: () -> bool
|
2352
|
+
|
2177
2353
|
def inspect: (inspector: NodeInspector) -> String
|
2178
2354
|
end
|
2179
2355
|
# Represents a keyword rest parameter to a method, block, or lambda definition.
|
@@ -2206,13 +2382,14 @@ module Prism
|
|
2206
2382
|
# ^^^^^^^^^^^^^^^^^^^^^^^
|
2207
2383
|
class LambdaNode < Node
|
2208
2384
|
attr_reader locals: Array[Symbol]
|
2385
|
+
attr_reader locals_body_index: Integer
|
2209
2386
|
attr_reader operator_loc: Location
|
2210
2387
|
attr_reader opening_loc: Location
|
2211
2388
|
attr_reader closing_loc: Location
|
2212
|
-
attr_reader parameters:
|
2389
|
+
attr_reader parameters: Node?
|
2213
2390
|
attr_reader body: Node?
|
2214
2391
|
|
2215
|
-
def initialize: (locals: Array[Symbol], operator_loc: Location, opening_loc: Location, closing_loc: Location, parameters:
|
2392
|
+
def initialize: (locals: Array[Symbol], locals_body_index: Integer, operator_loc: Location, opening_loc: Location, closing_loc: Location, parameters: Node?, body: Node?, location: Location) -> void
|
2216
2393
|
def accept: (visitor: Visitor) -> void
|
2217
2394
|
def set_newline_flag: (newline_marked: Array[bool]) -> void
|
2218
2395
|
def child_nodes: () -> Array[Node?]
|
@@ -2378,13 +2555,13 @@ module Prism
|
|
2378
2555
|
# if /foo/i then end
|
2379
2556
|
# ^^^^^^
|
2380
2557
|
class MatchLastLineNode < Node
|
2558
|
+
attr_reader flags: Integer
|
2381
2559
|
attr_reader opening_loc: Location
|
2382
2560
|
attr_reader content_loc: Location
|
2383
2561
|
attr_reader closing_loc: Location
|
2384
2562
|
attr_reader unescaped: String
|
2385
|
-
attr_reader flags: Integer
|
2386
2563
|
|
2387
|
-
def initialize: (opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String,
|
2564
|
+
def initialize: (flags: Integer, opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String, location: Location) -> void
|
2388
2565
|
def accept: (visitor: Visitor) -> void
|
2389
2566
|
def set_newline_flag: (newline_marked: Array[bool]) -> void
|
2390
2567
|
def child_nodes: () -> Array[Node?]
|
@@ -2394,12 +2571,6 @@ module Prism
|
|
2394
2571
|
|
2395
2572
|
def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, (Node | Array[Node] | String | Token | Array[Token] | Location)?]
|
2396
2573
|
|
2397
|
-
def opening: () -> String
|
2398
|
-
|
2399
|
-
def content: () -> String
|
2400
|
-
|
2401
|
-
def closing: () -> String
|
2402
|
-
|
2403
2574
|
def ignore_case?: () -> bool
|
2404
2575
|
|
2405
2576
|
def extended?: () -> bool
|
@@ -2416,6 +2587,18 @@ module Prism
|
|
2416
2587
|
|
2417
2588
|
def utf_8?: () -> bool
|
2418
2589
|
|
2590
|
+
def forced_utf8_encoding?: () -> bool
|
2591
|
+
|
2592
|
+
def forced_binary_encoding?: () -> bool
|
2593
|
+
|
2594
|
+
def forced_us_ascii_encoding?: () -> bool
|
2595
|
+
|
2596
|
+
def opening: () -> String
|
2597
|
+
|
2598
|
+
def content: () -> String
|
2599
|
+
|
2600
|
+
def closing: () -> String
|
2601
|
+
|
2419
2602
|
def inspect: (inspector: NodeInspector) -> String
|
2420
2603
|
end
|
2421
2604
|
# Represents the use of the modifier `in` operator.
|
@@ -2471,9 +2654,9 @@ module Prism
|
|
2471
2654
|
# ^^^^^^^^^^^^^^^^^^^^
|
2472
2655
|
class MatchWriteNode < Node
|
2473
2656
|
attr_reader call: CallNode
|
2474
|
-
attr_reader
|
2657
|
+
attr_reader targets: Array[Node]
|
2475
2658
|
|
2476
|
-
def initialize: (call: CallNode,
|
2659
|
+
def initialize: (call: CallNode, targets: Array[Node], location: Location) -> void
|
2477
2660
|
def accept: (visitor: Visitor) -> void
|
2478
2661
|
def set_newline_flag: (newline_marked: Array[bool]) -> void
|
2479
2662
|
def child_nodes: () -> Array[Node?]
|
@@ -2652,6 +2835,26 @@ module Prism
|
|
2652
2835
|
|
2653
2836
|
def inspect: (inspector: NodeInspector) -> String
|
2654
2837
|
end
|
2838
|
+
# Represents an implicit set of parameters through the use of numbered
|
2839
|
+
# parameters within a block or lambda.
|
2840
|
+
#
|
2841
|
+
# -> { _1 + _2 }
|
2842
|
+
# ^^^^^^^^^^^^^^
|
2843
|
+
class NumberedParametersNode < Node
|
2844
|
+
attr_reader maximum: Integer
|
2845
|
+
|
2846
|
+
def initialize: (maximum: Integer, location: Location) -> void
|
2847
|
+
def accept: (visitor: Visitor) -> void
|
2848
|
+
def set_newline_flag: (newline_marked: Array[bool]) -> void
|
2849
|
+
def child_nodes: () -> Array[Node?]
|
2850
|
+
def deconstruct: () -> Array[Node?]
|
2851
|
+
|
2852
|
+
def copy: (**untyped) -> NumberedParametersNode
|
2853
|
+
|
2854
|
+
def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, (Node | Array[Node] | String | Token | Array[Token] | Location)?]
|
2855
|
+
|
2856
|
+
def inspect: (inspector: NodeInspector) -> String
|
2857
|
+
end
|
2655
2858
|
# Represents reading a numbered reference to a capture in the previous match.
|
2656
2859
|
#
|
2657
2860
|
# $1
|
@@ -2749,13 +2952,13 @@ module Prism
|
|
2749
2952
|
class ParametersNode < Node
|
2750
2953
|
attr_reader requireds: Array[Node]
|
2751
2954
|
attr_reader optionals: Array[Node]
|
2752
|
-
attr_reader rest:
|
2955
|
+
attr_reader rest: Node?
|
2753
2956
|
attr_reader posts: Array[Node]
|
2754
2957
|
attr_reader keywords: Array[Node]
|
2755
2958
|
attr_reader keyword_rest: Node?
|
2756
2959
|
attr_reader block: BlockParameterNode?
|
2757
2960
|
|
2758
|
-
def initialize: (requireds: Array[Node], optionals: Array[Node], rest:
|
2961
|
+
def initialize: (requireds: Array[Node], optionals: Array[Node], rest: Node?, posts: Array[Node], keywords: Array[Node], keyword_rest: Node?, block: BlockParameterNode?, location: Location) -> void
|
2759
2962
|
def accept: (visitor: Visitor) -> void
|
2760
2963
|
def set_newline_flag: (newline_marked: Array[bool]) -> void
|
2761
2964
|
def child_nodes: () -> Array[Node?]
|
@@ -2925,12 +3128,12 @@ module Prism
|
|
2925
3128
|
# c if a =~ /left/ ... b =~ /right/
|
2926
3129
|
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2927
3130
|
class RangeNode < Node
|
3131
|
+
attr_reader flags: Integer
|
2928
3132
|
attr_reader left: Node?
|
2929
3133
|
attr_reader right: Node?
|
2930
3134
|
attr_reader operator_loc: Location
|
2931
|
-
attr_reader flags: Integer
|
2932
3135
|
|
2933
|
-
def initialize: (left: Node?, right: Node?, operator_loc: Location,
|
3136
|
+
def initialize: (flags: Integer, left: Node?, right: Node?, operator_loc: Location, location: Location) -> void
|
2934
3137
|
def accept: (visitor: Visitor) -> void
|
2935
3138
|
def set_newline_flag: (newline_marked: Array[bool]) -> void
|
2936
3139
|
def child_nodes: () -> Array[Node?]
|
@@ -2940,10 +3143,10 @@ module Prism
|
|
2940
3143
|
|
2941
3144
|
def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, (Node | Array[Node] | String | Token | Array[Token] | Location)?]
|
2942
3145
|
|
2943
|
-
def operator: () -> String
|
2944
|
-
|
2945
3146
|
def exclude_end?: () -> bool
|
2946
3147
|
|
3148
|
+
def operator: () -> String
|
3149
|
+
|
2947
3150
|
def inspect: (inspector: NodeInspector) -> String
|
2948
3151
|
end
|
2949
3152
|
# Represents a rational number literal.
|
@@ -2988,13 +3191,13 @@ module Prism
|
|
2988
3191
|
# /foo/i
|
2989
3192
|
# ^^^^^^
|
2990
3193
|
class RegularExpressionNode < Node
|
3194
|
+
attr_reader flags: Integer
|
2991
3195
|
attr_reader opening_loc: Location
|
2992
3196
|
attr_reader content_loc: Location
|
2993
3197
|
attr_reader closing_loc: Location
|
2994
3198
|
attr_reader unescaped: String
|
2995
|
-
attr_reader flags: Integer
|
2996
3199
|
|
2997
|
-
def initialize: (opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String,
|
3200
|
+
def initialize: (flags: Integer, opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String, location: Location) -> void
|
2998
3201
|
def accept: (visitor: Visitor) -> void
|
2999
3202
|
def set_newline_flag: (newline_marked: Array[bool]) -> void
|
3000
3203
|
def child_nodes: () -> Array[Node?]
|
@@ -3004,12 +3207,6 @@ module Prism
|
|
3004
3207
|
|
3005
3208
|
def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, (Node | Array[Node] | String | Token | Array[Token] | Location)?]
|
3006
3209
|
|
3007
|
-
def opening: () -> String
|
3008
|
-
|
3009
|
-
def content: () -> String
|
3010
|
-
|
3011
|
-
def closing: () -> String
|
3012
|
-
|
3013
3210
|
def ignore_case?: () -> bool
|
3014
3211
|
|
3015
3212
|
def extended?: () -> bool
|
@@ -3026,6 +3223,18 @@ module Prism
|
|
3026
3223
|
|
3027
3224
|
def utf_8?: () -> bool
|
3028
3225
|
|
3226
|
+
def forced_utf8_encoding?: () -> bool
|
3227
|
+
|
3228
|
+
def forced_binary_encoding?: () -> bool
|
3229
|
+
|
3230
|
+
def forced_us_ascii_encoding?: () -> bool
|
3231
|
+
|
3232
|
+
def opening: () -> String
|
3233
|
+
|
3234
|
+
def content: () -> String
|
3235
|
+
|
3236
|
+
def closing: () -> String
|
3237
|
+
|
3029
3238
|
def inspect: (inspector: NodeInspector) -> String
|
3030
3239
|
end
|
3031
3240
|
# Represents a required keyword parameter to a method, block, or lambda definition.
|
@@ -3334,26 +3543,6 @@ module Prism
|
|
3334
3543
|
|
3335
3544
|
def inspect: (inspector: NodeInspector) -> String
|
3336
3545
|
end
|
3337
|
-
# Represents the use of compile-time string concatenation.
|
3338
|
-
#
|
3339
|
-
# "foo" "bar"
|
3340
|
-
# ^^^^^^^^^^^
|
3341
|
-
class StringConcatNode < Node
|
3342
|
-
attr_reader left: Node
|
3343
|
-
attr_reader right: Node
|
3344
|
-
|
3345
|
-
def initialize: (left: Node, right: Node, location: Location) -> void
|
3346
|
-
def accept: (visitor: Visitor) -> void
|
3347
|
-
def set_newline_flag: (newline_marked: Array[bool]) -> void
|
3348
|
-
def child_nodes: () -> Array[Node?]
|
3349
|
-
def deconstruct: () -> Array[Node?]
|
3350
|
-
|
3351
|
-
def copy: (**untyped) -> StringConcatNode
|
3352
|
-
|
3353
|
-
def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, (Node | Array[Node] | String | Token | Array[Token] | Location)?]
|
3354
|
-
|
3355
|
-
def inspect: (inspector: NodeInspector) -> String
|
3356
|
-
end
|
3357
3546
|
# Represents a string literal, a string contained within a `%w` list, or
|
3358
3547
|
# plain string content within an interpolated string.
|
3359
3548
|
#
|
@@ -3382,6 +3571,10 @@ module Prism
|
|
3382
3571
|
|
3383
3572
|
def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, (Node | Array[Node] | String | Token | Array[Token] | Location)?]
|
3384
3573
|
|
3574
|
+
def forced_utf8_encoding?: () -> bool
|
3575
|
+
|
3576
|
+
def forced_binary_encoding?: () -> bool
|
3577
|
+
|
3385
3578
|
def frozen?: () -> bool
|
3386
3579
|
|
3387
3580
|
def opening: () -> String?
|
@@ -3432,12 +3625,13 @@ module Prism
|
|
3432
3625
|
# %i[foo]
|
3433
3626
|
# ^^^
|
3434
3627
|
class SymbolNode < Node
|
3628
|
+
attr_reader flags: Integer
|
3435
3629
|
attr_reader opening_loc: Location?
|
3436
3630
|
attr_reader value_loc: Location?
|
3437
3631
|
attr_reader closing_loc: Location?
|
3438
3632
|
attr_reader unescaped: String
|
3439
3633
|
|
3440
|
-
def initialize: (opening_loc: Location?, value_loc: Location?, closing_loc: Location?, unescaped: String, location: Location) -> void
|
3634
|
+
def initialize: (flags: Integer, opening_loc: Location?, value_loc: Location?, closing_loc: Location?, unescaped: String, location: Location) -> void
|
3441
3635
|
def accept: (visitor: Visitor) -> void
|
3442
3636
|
def set_newline_flag: (newline_marked: Array[bool]) -> void
|
3443
3637
|
def child_nodes: () -> Array[Node?]
|
@@ -3447,6 +3641,12 @@ module Prism
|
|
3447
3641
|
|
3448
3642
|
def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, (Node | Array[Node] | String | Token | Array[Token] | Location)?]
|
3449
3643
|
|
3644
|
+
def forced_utf8_encoding?: () -> bool
|
3645
|
+
|
3646
|
+
def forced_binary_encoding?: () -> bool
|
3647
|
+
|
3648
|
+
def forced_us_ascii_encoding?: () -> bool
|
3649
|
+
|
3450
3650
|
def opening: () -> String?
|
3451
3651
|
|
3452
3652
|
def value: () -> String?
|
@@ -3505,11 +3705,12 @@ module Prism
|
|
3505
3705
|
class UnlessNode < Node
|
3506
3706
|
attr_reader keyword_loc: Location
|
3507
3707
|
attr_reader predicate: Node
|
3708
|
+
attr_reader then_keyword_loc: Location?
|
3508
3709
|
attr_reader statements: StatementsNode?
|
3509
3710
|
attr_reader consequent: ElseNode?
|
3510
3711
|
attr_reader end_keyword_loc: Location?
|
3511
3712
|
|
3512
|
-
def initialize: (keyword_loc: Location, predicate: Node, statements: StatementsNode?, consequent: ElseNode?, end_keyword_loc: Location?, location: Location) -> void
|
3713
|
+
def initialize: (keyword_loc: Location, predicate: Node, then_keyword_loc: Location?, statements: StatementsNode?, consequent: ElseNode?, end_keyword_loc: Location?, location: Location) -> void
|
3513
3714
|
def accept: (visitor: Visitor) -> void
|
3514
3715
|
def set_newline_flag: (newline_marked: Array[bool]) -> void
|
3515
3716
|
def child_nodes: () -> Array[Node?]
|
@@ -3521,6 +3722,8 @@ module Prism
|
|
3521
3722
|
|
3522
3723
|
def keyword: () -> String
|
3523
3724
|
|
3725
|
+
def then_keyword: () -> String?
|
3726
|
+
|
3524
3727
|
def end_keyword: () -> String?
|
3525
3728
|
|
3526
3729
|
def inspect: (inspector: NodeInspector) -> String
|
@@ -3533,13 +3736,13 @@ module Prism
|
|
3533
3736
|
# until foo do bar end
|
3534
3737
|
# ^^^^^^^^^^^^^^^^^^^^
|
3535
3738
|
class UntilNode < Node
|
3739
|
+
attr_reader flags: Integer
|
3536
3740
|
attr_reader keyword_loc: Location
|
3537
3741
|
attr_reader closing_loc: Location?
|
3538
3742
|
attr_reader predicate: Node
|
3539
3743
|
attr_reader statements: StatementsNode?
|
3540
|
-
attr_reader flags: Integer
|
3541
3744
|
|
3542
|
-
def initialize: (keyword_loc: Location, closing_loc: Location?, predicate: Node, statements: StatementsNode?,
|
3745
|
+
def initialize: (flags: Integer, keyword_loc: Location, closing_loc: Location?, predicate: Node, statements: StatementsNode?, location: Location) -> void
|
3543
3746
|
def accept: (visitor: Visitor) -> void
|
3544
3747
|
def set_newline_flag: (newline_marked: Array[bool]) -> void
|
3545
3748
|
def child_nodes: () -> Array[Node?]
|
@@ -3549,12 +3752,12 @@ module Prism
|
|
3549
3752
|
|
3550
3753
|
def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, (Node | Array[Node] | String | Token | Array[Token] | Location)?]
|
3551
3754
|
|
3755
|
+
def begin_modifier?: () -> bool
|
3756
|
+
|
3552
3757
|
def keyword: () -> String
|
3553
3758
|
|
3554
3759
|
def closing: () -> String?
|
3555
3760
|
|
3556
|
-
def begin_modifier?: () -> bool
|
3557
|
-
|
3558
3761
|
def inspect: (inspector: NodeInspector) -> String
|
3559
3762
|
end
|
3560
3763
|
# Represents the use of the `when` keyword within a case statement.
|
@@ -3590,13 +3793,13 @@ module Prism
|
|
3590
3793
|
# while foo do bar end
|
3591
3794
|
# ^^^^^^^^^^^^^^^^^^^^
|
3592
3795
|
class WhileNode < Node
|
3796
|
+
attr_reader flags: Integer
|
3593
3797
|
attr_reader keyword_loc: Location
|
3594
3798
|
attr_reader closing_loc: Location?
|
3595
3799
|
attr_reader predicate: Node
|
3596
3800
|
attr_reader statements: StatementsNode?
|
3597
|
-
attr_reader flags: Integer
|
3598
3801
|
|
3599
|
-
def initialize: (keyword_loc: Location, closing_loc: Location?, predicate: Node, statements: StatementsNode?,
|
3802
|
+
def initialize: (flags: Integer, keyword_loc: Location, closing_loc: Location?, predicate: Node, statements: StatementsNode?, location: Location) -> void
|
3600
3803
|
def accept: (visitor: Visitor) -> void
|
3601
3804
|
def set_newline_flag: (newline_marked: Array[bool]) -> void
|
3602
3805
|
def child_nodes: () -> Array[Node?]
|
@@ -3606,12 +3809,12 @@ module Prism
|
|
3606
3809
|
|
3607
3810
|
def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, (Node | Array[Node] | String | Token | Array[Token] | Location)?]
|
3608
3811
|
|
3812
|
+
def begin_modifier?: () -> bool
|
3813
|
+
|
3609
3814
|
def keyword: () -> String
|
3610
3815
|
|
3611
3816
|
def closing: () -> String?
|
3612
3817
|
|
3613
|
-
def begin_modifier?: () -> bool
|
3614
|
-
|
3615
3818
|
def inspect: (inspector: NodeInspector) -> String
|
3616
3819
|
end
|
3617
3820
|
# Represents an xstring literal with no interpolation.
|
@@ -3619,12 +3822,13 @@ module Prism
|
|
3619
3822
|
# `foo`
|
3620
3823
|
# ^^^^^
|
3621
3824
|
class XStringNode < Node
|
3825
|
+
attr_reader flags: Integer
|
3622
3826
|
attr_reader opening_loc: Location
|
3623
3827
|
attr_reader content_loc: Location
|
3624
3828
|
attr_reader closing_loc: Location
|
3625
3829
|
attr_reader unescaped: String
|
3626
3830
|
|
3627
|
-
def initialize: (opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String, location: Location) -> void
|
3831
|
+
def initialize: (flags: Integer, opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String, location: Location) -> void
|
3628
3832
|
def accept: (visitor: Visitor) -> void
|
3629
3833
|
def set_newline_flag: (newline_marked: Array[bool]) -> void
|
3630
3834
|
def child_nodes: () -> Array[Node?]
|
@@ -3634,6 +3838,10 @@ module Prism
|
|
3634
3838
|
|
3635
3839
|
def deconstruct_keys: (keys: Array[Symbol]) -> Hash[Symbol, (Node | Array[Node] | String | Token | Array[Token] | Location)?]
|
3636
3840
|
|
3841
|
+
def forced_utf8_encoding?: () -> bool
|
3842
|
+
|
3843
|
+
def forced_binary_encoding?: () -> bool
|
3844
|
+
|
3637
3845
|
def opening: () -> String
|
3638
3846
|
|
3639
3847
|
def content: () -> String
|
@@ -3674,7 +3882,13 @@ module Prism
|
|
3674
3882
|
# Flags for arguments nodes.
|
3675
3883
|
module ArgumentsNodeFlags
|
3676
3884
|
# if arguments contain keyword splat
|
3677
|
-
|
3885
|
+
CONTAINS_KEYWORD_SPLAT: Integer
|
3886
|
+
end
|
3887
|
+
|
3888
|
+
# Flags for array nodes.
|
3889
|
+
module ArrayNodeFlags
|
3890
|
+
# if array contains splat nodes
|
3891
|
+
CONTAINS_SPLAT: Integer
|
3678
3892
|
end
|
3679
3893
|
|
3680
3894
|
# Flags for call nodes.
|
@@ -3683,20 +3897,36 @@ module Prism
|
|
3683
3897
|
SAFE_NAVIGATION: Integer
|
3684
3898
|
# a call that could have been a local variable
|
3685
3899
|
VARIABLE_CALL: Integer
|
3900
|
+
# a call that is an attribute write, so the value being written should be returned
|
3901
|
+
ATTRIBUTE_WRITE: Integer
|
3902
|
+
end
|
3903
|
+
|
3904
|
+
# Flags for nodes that have unescaped content.
|
3905
|
+
module EncodingFlags
|
3906
|
+
# internal bytes forced the encoding to UTF-8
|
3907
|
+
FORCED_UTF8_ENCODING: Integer
|
3908
|
+
# internal bytes forced the encoding to binary
|
3909
|
+
FORCED_BINARY_ENCODING: Integer
|
3686
3910
|
end
|
3687
3911
|
|
3688
3912
|
# Flags for integer nodes that correspond to the base of the integer.
|
3689
3913
|
module IntegerBaseFlags
|
3690
3914
|
# 0b prefix
|
3691
3915
|
BINARY: Integer
|
3692
|
-
# 0o or 0 prefix
|
3693
|
-
OCTAL: Integer
|
3694
3916
|
# 0d or no prefix
|
3695
3917
|
DECIMAL: Integer
|
3918
|
+
# 0o or 0 prefix
|
3919
|
+
OCTAL: Integer
|
3696
3920
|
# 0x prefix
|
3697
3921
|
HEXADECIMAL: Integer
|
3698
3922
|
end
|
3699
3923
|
|
3924
|
+
# Flags for keyword hash nodes.
|
3925
|
+
module KeywordHashNodeFlags
|
3926
|
+
# a keyword hash which only has `AssocNode` elements all with static literal keys, which means the elements can be treated as keyword arguments
|
3927
|
+
STATIC_KEYS: Integer
|
3928
|
+
end
|
3929
|
+
|
3700
3930
|
# Flags for while and until loop nodes.
|
3701
3931
|
module LoopFlags
|
3702
3932
|
# a loop after a begin statement, so the body is executed first before the condition
|
@@ -3727,14 +3957,34 @@ module Prism
|
|
3727
3957
|
WINDOWS_31J: Integer
|
3728
3958
|
# u - forces the UTF-8 encoding
|
3729
3959
|
UTF_8: Integer
|
3960
|
+
# internal bytes forced the encoding to UTF-8
|
3961
|
+
FORCED_UTF8_ENCODING: Integer
|
3962
|
+
# internal bytes forced the encoding to binary
|
3963
|
+
FORCED_BINARY_ENCODING: Integer
|
3964
|
+
# internal bytes forced the encoding to US-ASCII
|
3965
|
+
FORCED_US_ASCII_ENCODING: Integer
|
3730
3966
|
end
|
3731
3967
|
|
3732
3968
|
# Flags for string nodes.
|
3733
3969
|
module StringFlags
|
3970
|
+
# internal bytes forced the encoding to UTF-8
|
3971
|
+
FORCED_UTF8_ENCODING: Integer
|
3972
|
+
# internal bytes forced the encoding to binary
|
3973
|
+
FORCED_BINARY_ENCODING: Integer
|
3734
3974
|
# frozen by virtue of a `frozen_string_literal` comment
|
3735
3975
|
FROZEN: Integer
|
3736
3976
|
end
|
3737
3977
|
|
3978
|
+
# Flags for symbol nodes.
|
3979
|
+
module SymbolFlags
|
3980
|
+
# internal bytes forced the encoding to UTF-8
|
3981
|
+
FORCED_UTF8_ENCODING: Integer
|
3982
|
+
# internal bytes forced the encoding to binary
|
3983
|
+
FORCED_BINARY_ENCODING: Integer
|
3984
|
+
# internal bytes forced the encoding to US-ASCII
|
3985
|
+
FORCED_US_ASCII_ENCODING: Integer
|
3986
|
+
end
|
3987
|
+
|
3738
3988
|
|
3739
3989
|
class Visitor < BasicVisitor
|
3740
3990
|
# Visit a AliasGlobalVariableNode node
|
@@ -3800,9 +4050,15 @@ module Prism
|
|
3800
4050
|
# Visit a CallOrWriteNode node
|
3801
4051
|
def visit_call_or_write_node: (node: CallOrWriteNode) -> void
|
3802
4052
|
|
4053
|
+
# Visit a CallTargetNode node
|
4054
|
+
def visit_call_target_node: (node: CallTargetNode) -> void
|
4055
|
+
|
3803
4056
|
# Visit a CapturePatternNode node
|
3804
4057
|
def visit_capture_pattern_node: (node: CapturePatternNode) -> void
|
3805
4058
|
|
4059
|
+
# Visit a CaseMatchNode node
|
4060
|
+
def visit_case_match_node: (node: CaseMatchNode) -> void
|
4061
|
+
|
3806
4062
|
# Visit a CaseNode node
|
3807
4063
|
def visit_case_node: (node: CaseNode) -> void
|
3808
4064
|
|
@@ -3938,6 +4194,9 @@ module Prism
|
|
3938
4194
|
# Visit a ImplicitNode node
|
3939
4195
|
def visit_implicit_node: (node: ImplicitNode) -> void
|
3940
4196
|
|
4197
|
+
# Visit a ImplicitRestNode node
|
4198
|
+
def visit_implicit_rest_node: (node: ImplicitRestNode) -> void
|
4199
|
+
|
3941
4200
|
# Visit a InNode node
|
3942
4201
|
def visit_in_node: (node: InNode) -> void
|
3943
4202
|
|
@@ -3950,6 +4209,9 @@ module Prism
|
|
3950
4209
|
# Visit a IndexOrWriteNode node
|
3951
4210
|
def visit_index_or_write_node: (node: IndexOrWriteNode) -> void
|
3952
4211
|
|
4212
|
+
# Visit a IndexTargetNode node
|
4213
|
+
def visit_index_target_node: (node: IndexTargetNode) -> void
|
4214
|
+
|
3953
4215
|
# Visit a InstanceVariableAndWriteNode node
|
3954
4216
|
def visit_instance_variable_and_write_node: (node: InstanceVariableAndWriteNode) -> void
|
3955
4217
|
|
@@ -4046,6 +4308,9 @@ module Prism
|
|
4046
4308
|
# Visit a NoKeywordsParameterNode node
|
4047
4309
|
def visit_no_keywords_parameter_node: (node: NoKeywordsParameterNode) -> void
|
4048
4310
|
|
4311
|
+
# Visit a NumberedParametersNode node
|
4312
|
+
def visit_numbered_parameters_node: (node: NumberedParametersNode) -> void
|
4313
|
+
|
4049
4314
|
# Visit a NumberedReferenceReadNode node
|
4050
4315
|
def visit_numbered_reference_read_node: (node: NumberedReferenceReadNode) -> void
|
4051
4316
|
|
@@ -4133,9 +4398,6 @@ module Prism
|
|
4133
4398
|
# Visit a StatementsNode node
|
4134
4399
|
def visit_statements_node: (node: StatementsNode) -> void
|
4135
4400
|
|
4136
|
-
# Visit a StringConcatNode node
|
4137
|
-
def visit_string_concat_node: (node: StringConcatNode) -> void
|
4138
|
-
|
4139
4401
|
# Visit a StringNode node
|
4140
4402
|
def visit_string_node: (node: StringNode) -> void
|
4141
4403
|
|
@@ -4185,9 +4447,9 @@ module Prism
|
|
4185
4447
|
# Create a new AndNode node
|
4186
4448
|
def AndNode: (left: Node, right: Node, operator_loc: Location, location: Location) -> AndNode
|
4187
4449
|
# Create a new ArgumentsNode node
|
4188
|
-
def ArgumentsNode: (arguments: Array[Node],
|
4450
|
+
def ArgumentsNode: (flags: Integer, arguments: Array[Node], location: Location) -> ArgumentsNode
|
4189
4451
|
# Create a new ArrayNode node
|
4190
|
-
def ArrayNode: (elements: Array[Node], opening_loc: Location?, closing_loc: Location?, location: Location) -> ArrayNode
|
4452
|
+
def ArrayNode: (flags: Integer, elements: Array[Node], opening_loc: Location?, closing_loc: Location?, location: Location) -> ArrayNode
|
4191
4453
|
# Create a new ArrayPatternNode node
|
4192
4454
|
def ArrayPatternNode: (constant: Node?, requireds: Array[Node], rest: Node?, posts: Array[Node], opening_loc: Location?, closing_loc: Location?, location: Location) -> ArrayPatternNode
|
4193
4455
|
# Create a new AssocNode node
|
@@ -4203,7 +4465,7 @@ module Prism
|
|
4203
4465
|
# Create a new BlockLocalVariableNode node
|
4204
4466
|
def BlockLocalVariableNode: (name: Symbol, location: Location) -> BlockLocalVariableNode
|
4205
4467
|
# Create a new BlockNode node
|
4206
|
-
def BlockNode: (locals: Array[Symbol], parameters:
|
4468
|
+
def BlockNode: (locals: Array[Symbol], locals_body_index: Integer, parameters: Node?, body: Node?, opening_loc: Location, closing_loc: Location, location: Location) -> BlockNode
|
4207
4469
|
# Create a new BlockParameterNode node
|
4208
4470
|
def BlockParameterNode: (name: Symbol?, name_loc: Location?, operator_loc: Location, location: Location) -> BlockParameterNode
|
4209
4471
|
# Create a new BlockParametersNode node
|
@@ -4211,15 +4473,19 @@ module Prism
|
|
4211
4473
|
# Create a new BreakNode node
|
4212
4474
|
def BreakNode: (arguments: ArgumentsNode?, keyword_loc: Location, location: Location) -> BreakNode
|
4213
4475
|
# Create a new CallAndWriteNode node
|
4214
|
-
def CallAndWriteNode: (receiver: Node?, call_operator_loc: Location?, message_loc: Location?,
|
4476
|
+
def CallAndWriteNode: (flags: Integer, receiver: Node?, call_operator_loc: Location?, message_loc: Location?, read_name: Symbol, write_name: Symbol, operator_loc: Location, value: Node, location: Location) -> CallAndWriteNode
|
4215
4477
|
# Create a new CallNode node
|
4216
|
-
def CallNode: (receiver: Node?, call_operator_loc: Location?, message_loc: Location?, opening_loc: Location?, arguments: ArgumentsNode?, closing_loc: Location?, block: Node?,
|
4478
|
+
def CallNode: (flags: Integer, receiver: Node?, call_operator_loc: Location?, name: Symbol, message_loc: Location?, opening_loc: Location?, arguments: ArgumentsNode?, closing_loc: Location?, block: Node?, location: Location) -> CallNode
|
4217
4479
|
# Create a new CallOperatorWriteNode node
|
4218
|
-
def CallOperatorWriteNode: (receiver: Node?, call_operator_loc: Location?, message_loc: Location?,
|
4480
|
+
def CallOperatorWriteNode: (flags: Integer, receiver: Node?, call_operator_loc: Location?, message_loc: Location?, read_name: Symbol, write_name: Symbol, operator: Symbol, operator_loc: Location, value: Node, location: Location) -> CallOperatorWriteNode
|
4219
4481
|
# Create a new CallOrWriteNode node
|
4220
|
-
def CallOrWriteNode: (receiver: Node?, call_operator_loc: Location?, message_loc: Location?,
|
4482
|
+
def CallOrWriteNode: (flags: Integer, receiver: Node?, call_operator_loc: Location?, message_loc: Location?, read_name: Symbol, write_name: Symbol, operator_loc: Location, value: Node, location: Location) -> CallOrWriteNode
|
4483
|
+
# Create a new CallTargetNode node
|
4484
|
+
def CallTargetNode: (flags: Integer, receiver: Node, call_operator_loc: Location, name: Symbol, message_loc: Location, location: Location) -> CallTargetNode
|
4221
4485
|
# Create a new CapturePatternNode node
|
4222
4486
|
def CapturePatternNode: (value: Node, target: Node, operator_loc: Location, location: Location) -> CapturePatternNode
|
4487
|
+
# Create a new CaseMatchNode node
|
4488
|
+
def CaseMatchNode: (predicate: Node?, conditions: Array[Node], consequent: ElseNode?, case_keyword_loc: Location, end_keyword_loc: Location, location: Location) -> CaseMatchNode
|
4223
4489
|
# Create a new CaseNode node
|
4224
4490
|
def CaseNode: (predicate: Node?, conditions: Array[Node], consequent: ElseNode?, case_keyword_loc: Location, end_keyword_loc: Location, location: Location) -> CaseNode
|
4225
4491
|
# Create a new ClassNode node
|
@@ -4261,7 +4527,7 @@ module Prism
|
|
4261
4527
|
# Create a new ConstantWriteNode node
|
4262
4528
|
def ConstantWriteNode: (name: Symbol, name_loc: Location, value: Node, operator_loc: Location, location: Location) -> ConstantWriteNode
|
4263
4529
|
# Create a new DefNode node
|
4264
|
-
def DefNode: (name: Symbol, name_loc: Location, receiver: Node?, parameters: ParametersNode?, body: Node?, locals: Array[Symbol], def_keyword_loc: Location, operator_loc: Location?, lparen_loc: Location?, rparen_loc: Location?, equal_loc: Location?, end_keyword_loc: Location?, location: Location) -> DefNode
|
4530
|
+
def DefNode: (name: Symbol, name_loc: Location, receiver: Node?, parameters: ParametersNode?, body: Node?, locals: Array[Symbol], locals_body_index: Integer, def_keyword_loc: Location, operator_loc: Location?, lparen_loc: Location?, rparen_loc: Location?, equal_loc: Location?, end_keyword_loc: Location?, location: Location) -> DefNode
|
4265
4531
|
# Create a new DefinedNode node
|
4266
4532
|
def DefinedNode: (lparen_loc: Location?, value: Node, rparen_loc: Location?, keyword_loc: Location, location: Location) -> DefinedNode
|
4267
4533
|
# Create a new ElseNode node
|
@@ -4277,7 +4543,7 @@ module Prism
|
|
4277
4543
|
# Create a new FindPatternNode node
|
4278
4544
|
def FindPatternNode: (constant: Node?, left: Node, requireds: Array[Node], right: Node, opening_loc: Location?, closing_loc: Location?, location: Location) -> FindPatternNode
|
4279
4545
|
# Create a new FlipFlopNode node
|
4280
|
-
def FlipFlopNode: (left: Node?, right: Node?, operator_loc: Location,
|
4546
|
+
def FlipFlopNode: (flags: Integer, left: Node?, right: Node?, operator_loc: Location, location: Location) -> FlipFlopNode
|
4281
4547
|
# Create a new FloatNode node
|
4282
4548
|
def FloatNode: (location: Location) -> FloatNode
|
4283
4549
|
# Create a new ForNode node
|
@@ -4305,19 +4571,23 @@ module Prism
|
|
4305
4571
|
# Create a new HashPatternNode node
|
4306
4572
|
def HashPatternNode: (constant: Node?, elements: Array[Node], rest: Node?, opening_loc: Location?, closing_loc: Location?, location: Location) -> HashPatternNode
|
4307
4573
|
# Create a new IfNode node
|
4308
|
-
def IfNode: (if_keyword_loc: Location?, predicate: Node, statements: StatementsNode?, consequent: Node?, end_keyword_loc: Location?, location: Location) -> IfNode
|
4574
|
+
def IfNode: (if_keyword_loc: Location?, predicate: Node, then_keyword_loc: Location?, statements: StatementsNode?, consequent: Node?, end_keyword_loc: Location?, location: Location) -> IfNode
|
4309
4575
|
# Create a new ImaginaryNode node
|
4310
4576
|
def ImaginaryNode: (numeric: Node, location: Location) -> ImaginaryNode
|
4311
4577
|
# Create a new ImplicitNode node
|
4312
4578
|
def ImplicitNode: (value: Node, location: Location) -> ImplicitNode
|
4579
|
+
# Create a new ImplicitRestNode node
|
4580
|
+
def ImplicitRestNode: (location: Location) -> ImplicitRestNode
|
4313
4581
|
# Create a new InNode node
|
4314
4582
|
def InNode: (pattern: Node, statements: StatementsNode?, in_loc: Location, then_loc: Location?, location: Location) -> InNode
|
4315
4583
|
# Create a new IndexAndWriteNode node
|
4316
|
-
def IndexAndWriteNode: (receiver: Node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Node?,
|
4584
|
+
def IndexAndWriteNode: (flags: Integer, receiver: Node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Node?, operator_loc: Location, value: Node, location: Location) -> IndexAndWriteNode
|
4317
4585
|
# Create a new IndexOperatorWriteNode node
|
4318
|
-
def IndexOperatorWriteNode: (receiver: Node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Node?,
|
4586
|
+
def IndexOperatorWriteNode: (flags: Integer, receiver: Node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Node?, operator: Symbol, operator_loc: Location, value: Node, location: Location) -> IndexOperatorWriteNode
|
4319
4587
|
# Create a new IndexOrWriteNode node
|
4320
|
-
def IndexOrWriteNode: (receiver: Node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Node?,
|
4588
|
+
def IndexOrWriteNode: (flags: Integer, receiver: Node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Node?, operator_loc: Location, value: Node, location: Location) -> IndexOrWriteNode
|
4589
|
+
# Create a new IndexTargetNode node
|
4590
|
+
def IndexTargetNode: (flags: Integer, receiver: Node, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Node?, location: Location) -> IndexTargetNode
|
4321
4591
|
# Create a new InstanceVariableAndWriteNode node
|
4322
4592
|
def InstanceVariableAndWriteNode: (name: Symbol, name_loc: Location, operator_loc: Location, value: Node, location: Location) -> InstanceVariableAndWriteNode
|
4323
4593
|
# Create a new InstanceVariableOperatorWriteNode node
|
@@ -4333,9 +4603,9 @@ module Prism
|
|
4333
4603
|
# Create a new IntegerNode node
|
4334
4604
|
def IntegerNode: (flags: Integer, location: Location) -> IntegerNode
|
4335
4605
|
# Create a new InterpolatedMatchLastLineNode node
|
4336
|
-
def InterpolatedMatchLastLineNode: (opening_loc: Location, parts: Array[Node], closing_loc: Location,
|
4606
|
+
def InterpolatedMatchLastLineNode: (flags: Integer, opening_loc: Location, parts: Array[Node], closing_loc: Location, location: Location) -> InterpolatedMatchLastLineNode
|
4337
4607
|
# Create a new InterpolatedRegularExpressionNode node
|
4338
|
-
def InterpolatedRegularExpressionNode: (opening_loc: Location, parts: Array[Node], closing_loc: Location,
|
4608
|
+
def InterpolatedRegularExpressionNode: (flags: Integer, opening_loc: Location, parts: Array[Node], closing_loc: Location, location: Location) -> InterpolatedRegularExpressionNode
|
4339
4609
|
# Create a new InterpolatedStringNode node
|
4340
4610
|
def InterpolatedStringNode: (opening_loc: Location?, parts: Array[Node], closing_loc: Location?, location: Location) -> InterpolatedStringNode
|
4341
4611
|
# Create a new InterpolatedSymbolNode node
|
@@ -4343,11 +4613,11 @@ module Prism
|
|
4343
4613
|
# Create a new InterpolatedXStringNode node
|
4344
4614
|
def InterpolatedXStringNode: (opening_loc: Location, parts: Array[Node], closing_loc: Location, location: Location) -> InterpolatedXStringNode
|
4345
4615
|
# Create a new KeywordHashNode node
|
4346
|
-
def KeywordHashNode: (elements: Array[Node], location: Location) -> KeywordHashNode
|
4616
|
+
def KeywordHashNode: (flags: Integer, elements: Array[Node], location: Location) -> KeywordHashNode
|
4347
4617
|
# Create a new KeywordRestParameterNode node
|
4348
4618
|
def KeywordRestParameterNode: (name: Symbol?, name_loc: Location?, operator_loc: Location, location: Location) -> KeywordRestParameterNode
|
4349
4619
|
# Create a new LambdaNode node
|
4350
|
-
def LambdaNode: (locals: Array[Symbol], operator_loc: Location, opening_loc: Location, closing_loc: Location, parameters:
|
4620
|
+
def LambdaNode: (locals: Array[Symbol], locals_body_index: Integer, operator_loc: Location, opening_loc: Location, closing_loc: Location, parameters: Node?, body: Node?, location: Location) -> LambdaNode
|
4351
4621
|
# Create a new LocalVariableAndWriteNode node
|
4352
4622
|
def LocalVariableAndWriteNode: (name_loc: Location, operator_loc: Location, value: Node, name: Symbol, depth: Integer, location: Location) -> LocalVariableAndWriteNode
|
4353
4623
|
# Create a new LocalVariableOperatorWriteNode node
|
@@ -4361,13 +4631,13 @@ module Prism
|
|
4361
4631
|
# Create a new LocalVariableWriteNode node
|
4362
4632
|
def LocalVariableWriteNode: (name: Symbol, depth: Integer, name_loc: Location, value: Node, operator_loc: Location, location: Location) -> LocalVariableWriteNode
|
4363
4633
|
# Create a new MatchLastLineNode node
|
4364
|
-
def MatchLastLineNode: (opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String,
|
4634
|
+
def MatchLastLineNode: (flags: Integer, opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String, location: Location) -> MatchLastLineNode
|
4365
4635
|
# Create a new MatchPredicateNode node
|
4366
4636
|
def MatchPredicateNode: (value: Node, pattern: Node, operator_loc: Location, location: Location) -> MatchPredicateNode
|
4367
4637
|
# Create a new MatchRequiredNode node
|
4368
4638
|
def MatchRequiredNode: (value: Node, pattern: Node, operator_loc: Location, location: Location) -> MatchRequiredNode
|
4369
4639
|
# Create a new MatchWriteNode node
|
4370
|
-
def MatchWriteNode: (call: CallNode,
|
4640
|
+
def MatchWriteNode: (call: CallNode, targets: Array[Node], location: Location) -> MatchWriteNode
|
4371
4641
|
# Create a new MissingNode node
|
4372
4642
|
def MissingNode: (location: Location) -> MissingNode
|
4373
4643
|
# Create a new ModuleNode node
|
@@ -4382,6 +4652,8 @@ module Prism
|
|
4382
4652
|
def NilNode: (location: Location) -> NilNode
|
4383
4653
|
# Create a new NoKeywordsParameterNode node
|
4384
4654
|
def NoKeywordsParameterNode: (operator_loc: Location, keyword_loc: Location, location: Location) -> NoKeywordsParameterNode
|
4655
|
+
# Create a new NumberedParametersNode node
|
4656
|
+
def NumberedParametersNode: (maximum: Integer, location: Location) -> NumberedParametersNode
|
4385
4657
|
# Create a new NumberedReferenceReadNode node
|
4386
4658
|
def NumberedReferenceReadNode: (number: Integer, location: Location) -> NumberedReferenceReadNode
|
4387
4659
|
# Create a new OptionalKeywordParameterNode node
|
@@ -4391,7 +4663,7 @@ module Prism
|
|
4391
4663
|
# Create a new OrNode node
|
4392
4664
|
def OrNode: (left: Node, right: Node, operator_loc: Location, location: Location) -> OrNode
|
4393
4665
|
# Create a new ParametersNode node
|
4394
|
-
def ParametersNode: (requireds: Array[Node], optionals: Array[Node], rest:
|
4666
|
+
def ParametersNode: (requireds: Array[Node], optionals: Array[Node], rest: Node?, posts: Array[Node], keywords: Array[Node], keyword_rest: Node?, block: BlockParameterNode?, location: Location) -> ParametersNode
|
4395
4667
|
# Create a new ParenthesesNode node
|
4396
4668
|
def ParenthesesNode: (body: Node?, opening_loc: Location, closing_loc: Location, location: Location) -> ParenthesesNode
|
4397
4669
|
# Create a new PinnedExpressionNode node
|
@@ -4405,13 +4677,13 @@ module Prism
|
|
4405
4677
|
# Create a new ProgramNode node
|
4406
4678
|
def ProgramNode: (locals: Array[Symbol], statements: StatementsNode, location: Location) -> ProgramNode
|
4407
4679
|
# Create a new RangeNode node
|
4408
|
-
def RangeNode: (left: Node?, right: Node?, operator_loc: Location,
|
4680
|
+
def RangeNode: (flags: Integer, left: Node?, right: Node?, operator_loc: Location, location: Location) -> RangeNode
|
4409
4681
|
# Create a new RationalNode node
|
4410
4682
|
def RationalNode: (numeric: Node, location: Location) -> RationalNode
|
4411
4683
|
# Create a new RedoNode node
|
4412
4684
|
def RedoNode: (location: Location) -> RedoNode
|
4413
4685
|
# Create a new RegularExpressionNode node
|
4414
|
-
def RegularExpressionNode: (opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String,
|
4686
|
+
def RegularExpressionNode: (flags: Integer, opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String, location: Location) -> RegularExpressionNode
|
4415
4687
|
# Create a new RequiredKeywordParameterNode node
|
4416
4688
|
def RequiredKeywordParameterNode: (name: Symbol, name_loc: Location, location: Location) -> RequiredKeywordParameterNode
|
4417
4689
|
# Create a new RequiredParameterNode node
|
@@ -4440,28 +4712,26 @@ module Prism
|
|
4440
4712
|
def SplatNode: (operator_loc: Location, expression: Node?, location: Location) -> SplatNode
|
4441
4713
|
# Create a new StatementsNode node
|
4442
4714
|
def StatementsNode: (body: Array[Node], location: Location) -> StatementsNode
|
4443
|
-
# Create a new StringConcatNode node
|
4444
|
-
def StringConcatNode: (left: Node, right: Node, location: Location) -> StringConcatNode
|
4445
4715
|
# Create a new StringNode node
|
4446
4716
|
def StringNode: (flags: Integer, opening_loc: Location?, content_loc: Location, closing_loc: Location?, unescaped: String, location: Location) -> StringNode
|
4447
4717
|
# Create a new SuperNode node
|
4448
4718
|
def SuperNode: (keyword_loc: Location, lparen_loc: Location?, arguments: ArgumentsNode?, rparen_loc: Location?, block: Node?, location: Location) -> SuperNode
|
4449
4719
|
# Create a new SymbolNode node
|
4450
|
-
def SymbolNode: (opening_loc: Location?, value_loc: Location?, closing_loc: Location?, unescaped: String, location: Location) -> SymbolNode
|
4720
|
+
def SymbolNode: (flags: Integer, opening_loc: Location?, value_loc: Location?, closing_loc: Location?, unescaped: String, location: Location) -> SymbolNode
|
4451
4721
|
# Create a new TrueNode node
|
4452
4722
|
def TrueNode: (location: Location) -> TrueNode
|
4453
4723
|
# Create a new UndefNode node
|
4454
4724
|
def UndefNode: (names: Array[Node], keyword_loc: Location, location: Location) -> UndefNode
|
4455
4725
|
# Create a new UnlessNode node
|
4456
|
-
def UnlessNode: (keyword_loc: Location, predicate: Node, statements: StatementsNode?, consequent: ElseNode?, end_keyword_loc: Location?, location: Location) -> UnlessNode
|
4726
|
+
def UnlessNode: (keyword_loc: Location, predicate: Node, then_keyword_loc: Location?, statements: StatementsNode?, consequent: ElseNode?, end_keyword_loc: Location?, location: Location) -> UnlessNode
|
4457
4727
|
# Create a new UntilNode node
|
4458
|
-
def UntilNode: (keyword_loc: Location, closing_loc: Location?, predicate: Node, statements: StatementsNode?,
|
4728
|
+
def UntilNode: (flags: Integer, keyword_loc: Location, closing_loc: Location?, predicate: Node, statements: StatementsNode?, location: Location) -> UntilNode
|
4459
4729
|
# Create a new WhenNode node
|
4460
4730
|
def WhenNode: (keyword_loc: Location, conditions: Array[Node], statements: StatementsNode?, location: Location) -> WhenNode
|
4461
4731
|
# Create a new WhileNode node
|
4462
|
-
def WhileNode: (keyword_loc: Location, closing_loc: Location?, predicate: Node, statements: StatementsNode?,
|
4732
|
+
def WhileNode: (flags: Integer, keyword_loc: Location, closing_loc: Location?, predicate: Node, statements: StatementsNode?, location: Location) -> WhileNode
|
4463
4733
|
# Create a new XStringNode node
|
4464
|
-
def XStringNode: (opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String, location: Location) -> XStringNode
|
4734
|
+
def XStringNode: (flags: Integer, opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String, location: Location) -> XStringNode
|
4465
4735
|
# Create a new YieldNode node
|
4466
4736
|
def YieldNode: (keyword_loc: Location, lparen_loc: Location?, arguments: ArgumentsNode?, rparen_loc: Location?, location: Location) -> YieldNode
|
4467
4737
|
end
|