prism 0.28.0 → 0.29.0

Sign up to get free protection for your applications and to get access to all the features.
data/sig/prism/node.rbs CHANGED
@@ -504,13 +504,13 @@ module Prism
504
504
  attr_reader message_loc: Location?
505
505
  attr_reader read_name: Symbol
506
506
  attr_reader write_name: Symbol
507
- attr_reader operator: Symbol
508
- attr_reader operator_loc: Location
507
+ attr_reader binary_operator: Symbol
508
+ attr_reader binary_operator_loc: Location
509
509
  attr_reader value: Prism::node
510
510
 
511
- def initialize: (Source source, Integer flags, Prism::node? receiver, Location? call_operator_loc, Location? message_loc, Symbol read_name, Symbol write_name, Symbol operator, Location operator_loc, Prism::node value, Location location) -> void
512
- def copy: (?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?message_loc: Location?, ?read_name: Symbol, ?write_name: Symbol, ?operator: Symbol, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> CallOperatorWriteNode
513
- def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Prism::node?, call_operator_loc: Location?, message_loc: Location?, read_name: Symbol, write_name: Symbol, operator: Symbol, operator_loc: Location, value: Prism::node, location: Location }
511
+ def initialize: (Source source, Integer flags, Prism::node? receiver, Location? call_operator_loc, Location? message_loc, Symbol read_name, Symbol write_name, Symbol binary_operator, Location binary_operator_loc, Prism::node value, Location location) -> void
512
+ def copy: (?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?message_loc: Location?, ?read_name: Symbol, ?write_name: Symbol, ?binary_operator: Symbol, ?binary_operator_loc: Location, ?value: Prism::node, ?location: Location) -> CallOperatorWriteNode
513
+ def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Prism::node?, call_operator_loc: Location?, message_loc: Location?, read_name: Symbol, write_name: Symbol, binary_operator: Symbol, binary_operator_loc: Location, value: Prism::node, location: Location }
514
514
  def safe_navigation?: () -> bool
515
515
  def variable_call?: () -> bool
516
516
  def attribute_write?: () -> bool
@@ -715,13 +715,13 @@ module Prism
715
715
 
716
716
  attr_reader name: Symbol
717
717
  attr_reader name_loc: Location
718
- attr_reader operator_loc: Location
718
+ attr_reader binary_operator_loc: Location
719
719
  attr_reader value: Prism::node
720
- attr_reader operator: Symbol
720
+ attr_reader binary_operator: Symbol
721
721
 
722
- def initialize: (Source source, Symbol name, Location name_loc, Location operator_loc, Prism::node value, Symbol operator, Location location) -> void
723
- def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?operator: Symbol, ?location: Location) -> ClassVariableOperatorWriteNode
724
- def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, operator: Symbol, location: Location }
722
+ def initialize: (Source source, Symbol name, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol binary_operator, Location location) -> void
723
+ def copy: (?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol, ?location: Location) -> ClassVariableOperatorWriteNode
724
+ def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol, location: Location }
725
725
  def type: () -> :class_variable_operator_write_node
726
726
  | ...
727
727
  def self.type: () -> :class_variable_operator_write_node
@@ -833,13 +833,13 @@ module Prism
833
833
 
834
834
  attr_reader name: Symbol
835
835
  attr_reader name_loc: Location
836
- attr_reader operator_loc: Location
836
+ attr_reader binary_operator_loc: Location
837
837
  attr_reader value: Prism::node
838
- attr_reader operator: Symbol
838
+ attr_reader binary_operator: Symbol
839
839
 
840
- def initialize: (Source source, Symbol name, Location name_loc, Location operator_loc, Prism::node value, Symbol operator, Location location) -> void
841
- def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?operator: Symbol, ?location: Location) -> ConstantOperatorWriteNode
842
- def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, operator: Symbol, location: Location }
840
+ def initialize: (Source source, Symbol name, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol binary_operator, Location location) -> void
841
+ def copy: (?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol, ?location: Location) -> ConstantOperatorWriteNode
842
+ def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol, location: Location }
843
843
  def type: () -> :constant_operator_write_node
844
844
  | ...
845
845
  def self.type: () -> :constant_operator_write_node
@@ -915,13 +915,13 @@ module Prism
915
915
  include _Node
916
916
 
917
917
  attr_reader target: ConstantPathNode
918
- attr_reader operator_loc: Location
918
+ attr_reader binary_operator_loc: Location
919
919
  attr_reader value: Prism::node
920
- attr_reader operator: Symbol
920
+ attr_reader binary_operator: Symbol
921
921
 
922
- def initialize: (Source source, ConstantPathNode target, Location operator_loc, Prism::node value, Symbol operator, Location location) -> void
923
- def copy: (?target: ConstantPathNode, ?operator_loc: Location, ?value: Prism::node, ?operator: Symbol, ?location: Location) -> ConstantPathOperatorWriteNode
924
- def deconstruct_keys: (Array[Symbol] keys) -> { target: ConstantPathNode, operator_loc: Location, value: Prism::node, operator: Symbol, location: Location }
922
+ def initialize: (Source source, ConstantPathNode target, Location binary_operator_loc, Prism::node value, Symbol binary_operator, Location location) -> void
923
+ def copy: (?target: ConstantPathNode, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol, ?location: Location) -> ConstantPathOperatorWriteNode
924
+ def deconstruct_keys: (Array[Symbol] keys) -> { target: ConstantPathNode, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol, location: Location }
925
925
  def type: () -> :constant_path_operator_write_node
926
926
  | ...
927
927
  def self.type: () -> :constant_path_operator_write_node
@@ -1387,13 +1387,13 @@ module Prism
1387
1387
 
1388
1388
  attr_reader name: Symbol
1389
1389
  attr_reader name_loc: Location
1390
- attr_reader operator_loc: Location
1390
+ attr_reader binary_operator_loc: Location
1391
1391
  attr_reader value: Prism::node
1392
- attr_reader operator: Symbol
1392
+ attr_reader binary_operator: Symbol
1393
1393
 
1394
- def initialize: (Source source, Symbol name, Location name_loc, Location operator_loc, Prism::node value, Symbol operator, Location location) -> void
1395
- def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?operator: Symbol, ?location: Location) -> GlobalVariableOperatorWriteNode
1396
- def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, operator: Symbol, location: Location }
1394
+ def initialize: (Source source, Symbol name, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol binary_operator, Location location) -> void
1395
+ def copy: (?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol, ?location: Location) -> GlobalVariableOperatorWriteNode
1396
+ def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol, location: Location }
1397
1397
  def type: () -> :global_variable_operator_write_node
1398
1398
  | ...
1399
1399
  def self.type: () -> :global_variable_operator_write_node
@@ -1687,13 +1687,13 @@ module Prism
1687
1687
  attr_reader arguments: ArgumentsNode?
1688
1688
  attr_reader closing_loc: Location
1689
1689
  attr_reader block: Prism::node?
1690
- attr_reader operator: Symbol
1691
- attr_reader operator_loc: Location
1690
+ attr_reader binary_operator: Symbol
1691
+ attr_reader binary_operator_loc: Location
1692
1692
  attr_reader value: Prism::node
1693
1693
 
1694
- def initialize: (Source source, Integer flags, Prism::node? receiver, Location? call_operator_loc, Location opening_loc, ArgumentsNode? arguments, Location closing_loc, Prism::node? block, Symbol operator, Location operator_loc, Prism::node value, Location location) -> void
1695
- def copy: (?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: Prism::node?, ?operator: Symbol, ?operator_loc: Location, ?value: Prism::node, ?location: Location) -> IndexOperatorWriteNode
1696
- def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Prism::node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Prism::node?, operator: Symbol, operator_loc: Location, value: Prism::node, location: Location }
1694
+ def initialize: (Source source, Integer flags, Prism::node? receiver, Location? call_operator_loc, Location opening_loc, ArgumentsNode? arguments, Location closing_loc, Prism::node? block, Symbol binary_operator, Location binary_operator_loc, Prism::node value, Location location) -> void
1695
+ def copy: (?flags: Integer, ?receiver: Prism::node?, ?call_operator_loc: Location?, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: Prism::node?, ?binary_operator: Symbol, ?binary_operator_loc: Location, ?value: Prism::node, ?location: Location) -> IndexOperatorWriteNode
1696
+ def deconstruct_keys: (Array[Symbol] keys) -> { flags: Integer, receiver: Prism::node?, call_operator_loc: Location?, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: Prism::node?, binary_operator: Symbol, binary_operator_loc: Location, value: Prism::node, location: Location }
1697
1697
  def safe_navigation?: () -> bool
1698
1698
  def variable_call?: () -> bool
1699
1699
  def attribute_write?: () -> bool
@@ -1805,13 +1805,13 @@ module Prism
1805
1805
 
1806
1806
  attr_reader name: Symbol
1807
1807
  attr_reader name_loc: Location
1808
- attr_reader operator_loc: Location
1808
+ attr_reader binary_operator_loc: Location
1809
1809
  attr_reader value: Prism::node
1810
- attr_reader operator: Symbol
1810
+ attr_reader binary_operator: Symbol
1811
1811
 
1812
- def initialize: (Source source, Symbol name, Location name_loc, Location operator_loc, Prism::node value, Symbol operator, Location location) -> void
1813
- def copy: (?name: Symbol, ?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?operator: Symbol, ?location: Location) -> InstanceVariableOperatorWriteNode
1814
- def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, operator_loc: Location, value: Prism::node, operator: Symbol, location: Location }
1812
+ def initialize: (Source source, Symbol name, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol binary_operator, Location location) -> void
1813
+ def copy: (?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol, ?location: Location) -> InstanceVariableOperatorWriteNode
1814
+ def deconstruct_keys: (Array[Symbol] keys) -> { name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol, location: Location }
1815
1815
  def type: () -> :instance_variable_operator_write_node
1816
1816
  | ...
1817
1817
  def self.type: () -> :instance_variable_operator_write_node
@@ -2160,15 +2160,15 @@ module Prism
2160
2160
  include _Node
2161
2161
 
2162
2162
  attr_reader name_loc: Location
2163
- attr_reader operator_loc: Location
2163
+ attr_reader binary_operator_loc: Location
2164
2164
  attr_reader value: Prism::node
2165
2165
  attr_reader name: Symbol
2166
- attr_reader operator: Symbol
2166
+ attr_reader binary_operator: Symbol
2167
2167
  attr_reader depth: Integer
2168
2168
 
2169
- def initialize: (Source source, Location name_loc, Location operator_loc, Prism::node value, Symbol name, Symbol operator, Integer depth, Location location) -> void
2170
- def copy: (?name_loc: Location, ?operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?operator: Symbol, ?depth: Integer, ?location: Location) -> LocalVariableOperatorWriteNode
2171
- def deconstruct_keys: (Array[Symbol] keys) -> { name_loc: Location, operator_loc: Location, value: Prism::node, name: Symbol, operator: Symbol, depth: Integer, location: Location }
2169
+ def initialize: (Source source, Location name_loc, Location binary_operator_loc, Prism::node value, Symbol name, Symbol binary_operator, Integer depth, Location location) -> void
2170
+ def copy: (?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?name: Symbol, ?binary_operator: Symbol, ?depth: Integer, ?location: Location) -> LocalVariableOperatorWriteNode
2171
+ def deconstruct_keys: (Array[Symbol] keys) -> { name_loc: Location, binary_operator_loc: Location, value: Prism::node, name: Symbol, binary_operator: Symbol, depth: Integer, location: Location }
2172
2172
  def type: () -> :local_variable_operator_write_node
2173
2173
  | ...
2174
2174
  def self.type: () -> :local_variable_operator_write_node
@@ -2600,14 +2600,14 @@ module Prism
2600
2600
  attr_reader requireds: Array[RequiredParameterNode | MultiTargetNode]
2601
2601
  attr_reader optionals: Array[OptionalParameterNode]
2602
2602
  attr_reader rest: RestParameterNode | ImplicitRestNode | nil
2603
- attr_reader posts: Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode]
2603
+ attr_reader posts: Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode | ForwardingParameterNode]
2604
2604
  attr_reader keywords: Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode]
2605
2605
  attr_reader keyword_rest: KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode | nil
2606
2606
  attr_reader block: BlockParameterNode?
2607
2607
 
2608
- def initialize: (Source source, Array[RequiredParameterNode | MultiTargetNode] requireds, Array[OptionalParameterNode] optionals, RestParameterNode | ImplicitRestNode | nil rest, Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode] posts, Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode] keywords, KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode | nil keyword_rest, BlockParameterNode? block, Location location) -> void
2609
- def copy: (?requireds: Array[RequiredParameterNode | MultiTargetNode], ?optionals: Array[OptionalParameterNode], ?rest: RestParameterNode | ImplicitRestNode | nil, ?posts: Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode], ?keywords: Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode], ?keyword_rest: KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode | nil, ?block: BlockParameterNode?, ?location: Location) -> ParametersNode
2610
- def deconstruct_keys: (Array[Symbol] keys) -> { requireds: Array[RequiredParameterNode | MultiTargetNode], optionals: Array[OptionalParameterNode], rest: RestParameterNode | ImplicitRestNode | nil, posts: Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode], keywords: Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode], keyword_rest: KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode | nil, block: BlockParameterNode?, location: Location }
2608
+ def initialize: (Source source, Array[RequiredParameterNode | MultiTargetNode] requireds, Array[OptionalParameterNode] optionals, RestParameterNode | ImplicitRestNode | nil rest, Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode | ForwardingParameterNode] posts, Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode] keywords, KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode | nil keyword_rest, BlockParameterNode? block, Location location) -> void
2609
+ def copy: (?requireds: Array[RequiredParameterNode | MultiTargetNode], ?optionals: Array[OptionalParameterNode], ?rest: RestParameterNode | ImplicitRestNode | nil, ?posts: Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode | ForwardingParameterNode], ?keywords: Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode], ?keyword_rest: KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode | nil, ?block: BlockParameterNode?, ?location: Location) -> ParametersNode
2610
+ def deconstruct_keys: (Array[Symbol] keys) -> { requireds: Array[RequiredParameterNode | MultiTargetNode], optionals: Array[OptionalParameterNode], rest: RestParameterNode | ImplicitRestNode | nil, posts: Array[RequiredParameterNode | MultiTargetNode | KeywordRestParameterNode | NoKeywordsParameterNode | ForwardingParameterNode], keywords: Array[RequiredKeywordParameterNode | OptionalKeywordParameterNode], keyword_rest: KeywordRestParameterNode | ForwardingParameterNode | NoKeywordsParameterNode | nil, block: BlockParameterNode?, location: Location }
2611
2611
  def type: () -> :parameters_node
2612
2612
  | ...
2613
2613
  def self.type: () -> :parameters_node
@@ -75,4 +75,8 @@ module Prism
75
75
  class ParametersNode < Node
76
76
  def signature: () -> Array[[Symbol, Symbol] | [Symbol]]
77
77
  end
78
+
79
+ class CallNode < Node
80
+ def full_message_loc: () -> Location?
81
+ end
78
82
  end
data/src/diagnostic.c CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  #include "prism/diagnostic.h"
10
10
 
11
- #define PM_DIAGNOSTIC_ID_MAX 291
11
+ #define PM_DIAGNOSTIC_ID_MAX 301
12
12
 
13
13
  /** This struct holds the data for each diagnostic. */
14
14
  typedef struct {
@@ -99,22 +99,24 @@ static const pm_diagnostic_data_t diagnostic_messages[PM_DIAGNOSTIC_ID_MAX] = {
99
99
  [PM_ERR_ARGUMENT_AFTER_BLOCK] = { "unexpected argument after a block argument", PM_ERROR_LEVEL_SYNTAX },
100
100
  [PM_ERR_ARGUMENT_AFTER_FORWARDING_ELLIPSES] = { "unexpected argument after `...`", PM_ERROR_LEVEL_SYNTAX },
101
101
  [PM_ERR_ARGUMENT_BARE_HASH] = { "unexpected bare hash argument", PM_ERROR_LEVEL_SYNTAX },
102
- [PM_ERR_ARGUMENT_BLOCK_FORWARDING] = { "both a block argument and a forwarding argument; only one block is allowed", PM_ERROR_LEVEL_SYNTAX },
103
102
  [PM_ERR_ARGUMENT_BLOCK_MULTI] = { "both block arg and actual block given; only one block is allowed", PM_ERROR_LEVEL_SYNTAX },
103
+ [PM_ERR_ARGUMENT_CONFLICT_AMPERSAND] = { "unexpected `&`; anonymous block parameter is also used within block", PM_ERROR_LEVEL_SYNTAX },
104
+ [PM_ERR_ARGUMENT_CONFLICT_STAR] = { "unexpected `*`; anonymous rest parameter is also used within block", PM_ERROR_LEVEL_SYNTAX },
105
+ [PM_ERR_ARGUMENT_CONFLICT_STAR_STAR] = { "unexpected `**`; anonymous keyword rest parameter is also used within block", PM_ERROR_LEVEL_SYNTAX },
104
106
  [PM_ERR_ARGUMENT_FORMAL_CLASS] = { "invalid formal argument; formal argument cannot be a class variable", PM_ERROR_LEVEL_SYNTAX },
105
107
  [PM_ERR_ARGUMENT_FORMAL_CONSTANT] = { "invalid formal argument; formal argument cannot be a constant", PM_ERROR_LEVEL_SYNTAX },
106
108
  [PM_ERR_ARGUMENT_FORMAL_GLOBAL] = { "invalid formal argument; formal argument cannot be a global variable", PM_ERROR_LEVEL_SYNTAX },
107
109
  [PM_ERR_ARGUMENT_FORMAL_IVAR] = { "invalid formal argument; formal argument cannot be an instance variable", PM_ERROR_LEVEL_SYNTAX },
108
110
  [PM_ERR_ARGUMENT_FORWARDING_UNBOUND] = { "unexpected `...` in an non-parenthesized call", PM_ERROR_LEVEL_SYNTAX },
109
111
  [PM_ERR_ARGUMENT_IN] = { "unexpected `in` keyword in arguments", PM_ERROR_LEVEL_SYNTAX },
110
- [PM_ERR_ARGUMENT_NO_FORWARDING_AMP] = { "unexpected `&`; no anonymous block parameter", PM_ERROR_LEVEL_SYNTAX },
112
+ [PM_ERR_ARGUMENT_NO_FORWARDING_AMPERSAND] = { "unexpected `&`; no anonymous block parameter", PM_ERROR_LEVEL_SYNTAX },
111
113
  [PM_ERR_ARGUMENT_NO_FORWARDING_ELLIPSES] = { "unexpected ... when the parent method is not forwarding", PM_ERROR_LEVEL_SYNTAX },
112
114
  [PM_ERR_ARGUMENT_NO_FORWARDING_STAR] = { "unexpected `*`; no anonymous rest parameter", PM_ERROR_LEVEL_SYNTAX },
113
115
  [PM_ERR_ARGUMENT_NO_FORWARDING_STAR_STAR] = { "unexpected `**`; no anonymous keyword rest parameter", PM_ERROR_LEVEL_SYNTAX },
114
116
  [PM_ERR_ARGUMENT_SPLAT_AFTER_ASSOC_SPLAT] = { "unexpected `*` splat argument after a `**` keyword splat argument", PM_ERROR_LEVEL_SYNTAX },
115
117
  [PM_ERR_ARGUMENT_SPLAT_AFTER_SPLAT] = { "unexpected `*` splat argument after a `*` splat argument", PM_ERROR_LEVEL_SYNTAX },
116
118
  [PM_ERR_ARGUMENT_TERM_PAREN] = { "unexpected %s; expected a `)` to close the arguments", PM_ERROR_LEVEL_SYNTAX },
117
- [PM_ERR_ARGUMENT_UNEXPECTED_BLOCK] = { "unexpected `{` after a method call without parenthesis", PM_ERROR_LEVEL_SYNTAX },
119
+ [PM_ERR_ARGUMENT_UNEXPECTED_BLOCK] = { "unexpected '{' after a method call without parenthesis", PM_ERROR_LEVEL_SYNTAX },
118
120
  [PM_ERR_ARRAY_ELEMENT] = { "expected an element for the array", PM_ERROR_LEVEL_SYNTAX },
119
121
  [PM_ERR_ARRAY_EXPRESSION] = { "expected an expression for the array element", PM_ERROR_LEVEL_SYNTAX },
120
122
  [PM_ERR_ARRAY_EXPRESSION_AFTER_STAR] = { "expected an expression after `*` in the array", PM_ERROR_LEVEL_SYNTAX },
@@ -154,7 +156,7 @@ static const pm_diagnostic_data_t diagnostic_messages[PM_DIAGNOSTIC_ID_MAX] = {
154
156
  [PM_ERR_DEF_ENDLESS_SETTER] = { "invalid method name; a setter method cannot be defined in an endless method definition", PM_ERROR_LEVEL_SYNTAX },
155
157
  [PM_ERR_DEF_NAME] = { "unexpected %s; expected a method name", PM_ERROR_LEVEL_SYNTAX },
156
158
  [PM_ERR_DEF_PARAMS_TERM] = { "expected a delimiter to close the parameters", PM_ERROR_LEVEL_SYNTAX },
157
- [PM_ERR_DEF_PARAMS_TERM_PAREN] = { "expected a `)` to close the parameters", PM_ERROR_LEVEL_SYNTAX },
159
+ [PM_ERR_DEF_PARAMS_TERM_PAREN] = { "unexpected %s; expected a `)` to close the parameters", PM_ERROR_LEVEL_SYNTAX },
158
160
  [PM_ERR_DEF_RECEIVER] = { "expected a receiver for the method definition", PM_ERROR_LEVEL_SYNTAX },
159
161
  [PM_ERR_DEF_RECEIVER_TERM] = { "expected a `.` or `::` after the receiver in a method definition", PM_ERROR_LEVEL_SYNTAX },
160
162
  [PM_ERR_DEF_TERM] = { "expected an `end` to close the `def` statement", PM_ERROR_LEVEL_SYNTAX },
@@ -182,11 +184,12 @@ static const pm_diagnostic_data_t diagnostic_messages[PM_DIAGNOSTIC_ID_MAX] = {
182
184
  [PM_ERR_EXPECT_EXPRESSION_AFTER_EQUAL] = { "expected an expression after `=`", PM_ERROR_LEVEL_SYNTAX },
183
185
  [PM_ERR_EXPECT_EXPRESSION_AFTER_LESS_LESS] = { "expected an expression after `<<`", PM_ERROR_LEVEL_SYNTAX },
184
186
  [PM_ERR_EXPECT_EXPRESSION_AFTER_LPAREN] = { "expected an expression after `(`", PM_ERROR_LEVEL_SYNTAX },
185
- [PM_ERR_EXPECT_EXPRESSION_AFTER_OPERATOR] = { "expected an expression after the operator", PM_ERROR_LEVEL_SYNTAX },
187
+ [PM_ERR_EXPECT_EXPRESSION_AFTER_OPERATOR] = { "unexpected %s; expected an expression after the operator", PM_ERROR_LEVEL_SYNTAX },
186
188
  [PM_ERR_EXPECT_EXPRESSION_AFTER_SPLAT] = { "expected an expression after `*` splat in an argument", PM_ERROR_LEVEL_SYNTAX },
187
189
  [PM_ERR_EXPECT_EXPRESSION_AFTER_SPLAT_HASH] = { "expected an expression after `**` in a hash", PM_ERROR_LEVEL_SYNTAX },
188
190
  [PM_ERR_EXPECT_EXPRESSION_AFTER_STAR] = { "expected an expression after `*`", PM_ERROR_LEVEL_SYNTAX },
189
191
  [PM_ERR_EXPECT_IDENT_REQ_PARAMETER] = { "expected an identifier for the required parameter", PM_ERROR_LEVEL_SYNTAX },
192
+ [PM_ERR_EXPECT_IN_DELIMITER] = { "expected a delimiter after the patterns of an `in` clause", PM_ERROR_LEVEL_SYNTAX },
190
193
  [PM_ERR_EXPECT_LPAREN_REQ_PARAMETER] = { "expected a `(` to start a required parameter", PM_ERROR_LEVEL_SYNTAX },
191
194
  [PM_ERR_EXPECT_MESSAGE] = { "unexpected %s; expecting a message to send to the receiver", PM_ERROR_LEVEL_SYNTAX },
192
195
  [PM_ERR_EXPECT_RBRACKET] = { "expected a matching `]`", PM_ERROR_LEVEL_SYNTAX },
@@ -214,9 +217,9 @@ static const pm_diagnostic_data_t diagnostic_messages[PM_DIAGNOSTIC_ID_MAX] = {
214
217
  [PM_ERR_HASH_KEY] = { "unexpected %s, expecting '}' or a key in the hash literal", PM_ERROR_LEVEL_SYNTAX },
215
218
  [PM_ERR_HASH_ROCKET] = { "expected a `=>` between the hash key and value", PM_ERROR_LEVEL_SYNTAX },
216
219
  [PM_ERR_HASH_TERM] = { "expected a `}` to close the hash literal", PM_ERROR_LEVEL_SYNTAX },
217
- [PM_ERR_HASH_VALUE] = { "expected a value in the hash literal", PM_ERROR_LEVEL_SYNTAX },
220
+ [PM_ERR_HASH_VALUE] = { "unexpected %s; expected a value in the hash literal", PM_ERROR_LEVEL_SYNTAX },
218
221
  [PM_ERR_HEREDOC_IDENTIFIER] = { "unterminated here document identifier", PM_ERROR_LEVEL_SYNTAX },
219
- [PM_ERR_HEREDOC_TERM] = { "unterminated heredoc; can't find string \"%.*s\"", PM_ERROR_LEVEL_SYNTAX },
222
+ [PM_ERR_HEREDOC_TERM] = { "unterminated heredoc; can't find string \"%.*s\" anywhere before EOF", PM_ERROR_LEVEL_SYNTAX },
220
223
  [PM_ERR_INCOMPLETE_QUESTION_MARK] = { "incomplete expression at `?`", PM_ERROR_LEVEL_SYNTAX },
221
224
  [PM_ERR_INCOMPLETE_VARIABLE_CLASS_3_3] = { "`%.*s' is not allowed as a class variable name", PM_ERROR_LEVEL_SYNTAX },
222
225
  [PM_ERR_INCOMPLETE_VARIABLE_CLASS] = { "'%.*s' is not allowed as a class variable name", PM_ERROR_LEVEL_SYNTAX },
@@ -224,11 +227,13 @@ static const pm_diagnostic_data_t diagnostic_messages[PM_DIAGNOSTIC_ID_MAX] = {
224
227
  [PM_ERR_INCOMPLETE_VARIABLE_INSTANCE] = { "'%.*s' is not allowed as an instance variable name", PM_ERROR_LEVEL_SYNTAX },
225
228
  [PM_ERR_INSTANCE_VARIABLE_BARE] = { "'@' without identifiers is not allowed as an instance variable name", PM_ERROR_LEVEL_SYNTAX },
226
229
  [PM_ERR_INVALID_BLOCK_EXIT] = { "Invalid %s", PM_ERROR_LEVEL_SYNTAX },
230
+ [PM_ERR_INVALID_ESCAPE_CHARACTER] = { "Invalid escape character syntax", PM_ERROR_LEVEL_SYNTAX },
227
231
  [PM_ERR_INVALID_FLOAT_EXPONENT] = { "invalid exponent", PM_ERROR_LEVEL_SYNTAX },
228
232
  [PM_ERR_INVALID_LOCAL_VARIABLE_READ] = { "identifier %.*s is not valid to get", PM_ERROR_LEVEL_SYNTAX },
229
233
  [PM_ERR_INVALID_LOCAL_VARIABLE_WRITE] = { "identifier %.*s is not valid to set", PM_ERROR_LEVEL_SYNTAX },
230
234
  [PM_ERR_INVALID_NUMBER_BINARY] = { "invalid binary number; numeric literal without digits", PM_ERROR_LEVEL_SYNTAX },
231
235
  [PM_ERR_INVALID_NUMBER_DECIMAL] = { "invalid decimal number; numeric literal without digits", PM_ERROR_LEVEL_SYNTAX },
236
+ [PM_ERR_INVALID_NUMBER_FRACTION] = { "unexpected fraction part after numeric literal", PM_ERROR_LEVEL_SYNTAX },
232
237
  [PM_ERR_INVALID_NUMBER_HEXADECIMAL] = { "invalid hexadecimal number; numeric literal without digits", PM_ERROR_LEVEL_SYNTAX },
233
238
  [PM_ERR_INVALID_NUMBER_OCTAL] = { "invalid octal number; numeric literal without digits", PM_ERROR_LEVEL_SYNTAX },
234
239
  [PM_ERR_INVALID_NUMBER_UNDERSCORE_INNER] = { "invalid underscore placement in number", PM_ERROR_LEVEL_SYNTAX },
@@ -278,6 +283,7 @@ static const pm_diagnostic_data_t diagnostic_messages[PM_DIAGNOSTIC_ID_MAX] = {
278
283
  [PM_ERR_PARAMETER_ASSOC_SPLAT_MULTI] = { "unexpected multiple `**` splat parameters", PM_ERROR_LEVEL_SYNTAX },
279
284
  [PM_ERR_PARAMETER_BLOCK_MULTI] = { "multiple block parameters; only one block is allowed", PM_ERROR_LEVEL_SYNTAX },
280
285
  [PM_ERR_PARAMETER_CIRCULAR] = { "circular argument reference - %.*s", PM_ERROR_LEVEL_SYNTAX },
286
+ [PM_ERR_PARAMETER_FORWARDING_AFTER_REST] = { "... after rest argument", PM_ERROR_LEVEL_SYNTAX },
281
287
  [PM_ERR_PARAMETER_METHOD_NAME] = { "unexpected name for a parameter", PM_ERROR_LEVEL_SYNTAX },
282
288
  [PM_ERR_PARAMETER_NAME_DUPLICATED] = { "duplicated argument name", PM_ERROR_LEVEL_SYNTAX },
283
289
  [PM_ERR_PARAMETER_NO_DEFAULT] = { "expected a default value for the parameter", PM_ERROR_LEVEL_SYNTAX },
@@ -300,9 +306,11 @@ static const pm_diagnostic_data_t diagnostic_messages[PM_DIAGNOSTIC_ID_MAX] = {
300
306
  [PM_ERR_PATTERN_EXPRESSION_AFTER_PIPE] = { "expected a pattern expression after the `|` operator", PM_ERROR_LEVEL_SYNTAX },
301
307
  [PM_ERR_PATTERN_EXPRESSION_AFTER_RANGE] = { "expected a pattern expression after the range operator", PM_ERROR_LEVEL_SYNTAX },
302
308
  [PM_ERR_PATTERN_EXPRESSION_AFTER_REST] = { "unexpected pattern expression after the `**` expression", PM_ERROR_LEVEL_SYNTAX },
303
- [PM_ERR_PATTERN_HASH_KEY] = { "expected a key in the hash pattern", PM_ERROR_LEVEL_SYNTAX },
309
+ [PM_ERR_PATTERN_HASH_IMPLICIT] = { "unexpected implicit hash in pattern; use '{' to delineate", PM_ERROR_LEVEL_SYNTAX },
310
+ [PM_ERR_PATTERN_HASH_KEY] = { "unexpected %s; expected a key in the hash pattern", PM_ERROR_LEVEL_SYNTAX },
304
311
  [PM_ERR_PATTERN_HASH_KEY_DUPLICATE] = { "duplicated key name", PM_ERROR_LEVEL_SYNTAX },
305
- [PM_ERR_PATTERN_HASH_KEY_LABEL] = { "expected a label as the key in the hash pattern", PM_ERROR_LEVEL_SYNTAX }, // TODO // THIS // AND // ABOVE // IS WEIRD
312
+ [PM_ERR_PATTERN_HASH_KEY_INTERPOLATED] = { "symbol literal with interpolation is not allowed", PM_ERROR_LEVEL_SYNTAX },
313
+ [PM_ERR_PATTERN_HASH_KEY_LABEL] = { "expected a label as the key in the hash pattern", PM_ERROR_LEVEL_SYNTAX },
306
314
  [PM_ERR_PATTERN_HASH_KEY_LOCALS] = { "key must be valid as local variables", PM_ERROR_LEVEL_SYNTAX },
307
315
  [PM_ERR_PATTERN_IDENT_AFTER_HROCKET] = { "expected an identifier after the `=>` operator", PM_ERROR_LEVEL_SYNTAX },
308
316
  [PM_ERR_PATTERN_LABEL_AFTER_COMMA] = { "expected a label after the `,` in the hash pattern", PM_ERROR_LEVEL_SYNTAX },
@@ -377,6 +385,7 @@ static const pm_diagnostic_data_t diagnostic_messages[PM_DIAGNOSTIC_ID_MAX] = {
377
385
  [PM_WARN_KEYWORD_EOL] = { "`%.*s` at the end of line without an expression", PM_WARNING_LEVEL_VERBOSE },
378
386
  [PM_WARN_LITERAL_IN_CONDITION_DEFAULT] = { "%sliteral in %s", PM_WARNING_LEVEL_DEFAULT },
379
387
  [PM_WARN_LITERAL_IN_CONDITION_VERBOSE] = { "%sliteral in %s", PM_WARNING_LEVEL_VERBOSE },
388
+ [PM_WARN_SHAREABLE_CONSTANT_VALUE_LINE] = { "'shareable_constant_value' is ignored unless in comment-only line", PM_WARNING_LEVEL_VERBOSE },
380
389
  [PM_WARN_SHEBANG_CARRIAGE_RETURN] = { "shebang line ending with \\r may cause problems", PM_WARNING_LEVEL_DEFAULT },
381
390
  [PM_WARN_UNEXPECTED_CARRIAGE_RETURN] = { "encountered \\r in middle of line, treated as a mere space", PM_WARNING_LEVEL_DEFAULT },
382
391
  [PM_WARN_UNREACHABLE_STATEMENT] = { "statement not reached", PM_WARNING_LEVEL_VERBOSE },
@@ -398,13 +407,16 @@ pm_diagnostic_id_human(pm_diagnostic_id_t diag_id) {
398
407
  case PM_ERR_ARGUMENT_BARE_HASH: return "argument_bare_hash";
399
408
  case PM_ERR_ARGUMENT_BLOCK_FORWARDING: return "argument_block_forwarding";
400
409
  case PM_ERR_ARGUMENT_BLOCK_MULTI: return "argument_block_multi";
410
+ case PM_ERR_ARGUMENT_CONFLICT_AMPERSAND: return "argument_conflict_ampersand";
411
+ case PM_ERR_ARGUMENT_CONFLICT_STAR: return "argument_conflict_star";
412
+ case PM_ERR_ARGUMENT_CONFLICT_STAR_STAR: return "argument_conflict_star_star";
401
413
  case PM_ERR_ARGUMENT_FORMAL_CLASS: return "argument_formal_class";
402
414
  case PM_ERR_ARGUMENT_FORMAL_CONSTANT: return "argument_formal_constant";
403
415
  case PM_ERR_ARGUMENT_FORMAL_GLOBAL: return "argument_formal_global";
404
416
  case PM_ERR_ARGUMENT_FORMAL_IVAR: return "argument_formal_ivar";
405
417
  case PM_ERR_ARGUMENT_FORWARDING_UNBOUND: return "argument_forwarding_unbound";
406
418
  case PM_ERR_ARGUMENT_IN: return "argument_in";
407
- case PM_ERR_ARGUMENT_NO_FORWARDING_AMP: return "argument_no_forwarding_amp";
419
+ case PM_ERR_ARGUMENT_NO_FORWARDING_AMPERSAND: return "argument_no_forwarding_ampersand";
408
420
  case PM_ERR_ARGUMENT_NO_FORWARDING_ELLIPSES: return "argument_no_forwarding_ellipses";
409
421
  case PM_ERR_ARGUMENT_NO_FORWARDING_STAR: return "argument_no_forwarding_star";
410
422
  case PM_ERR_ARGUMENT_NO_FORWARDING_STAR_STAR: return "argument_no_forwarding_star_star";
@@ -486,6 +498,7 @@ pm_diagnostic_id_human(pm_diagnostic_id_t diag_id) {
486
498
  case PM_ERR_EXPECT_EXPRESSION_AFTER_SPLAT_HASH: return "expect_expression_after_splat_hash";
487
499
  case PM_ERR_EXPECT_EXPRESSION_AFTER_STAR: return "expect_expression_after_star";
488
500
  case PM_ERR_EXPECT_IDENT_REQ_PARAMETER: return "expect_ident_req_parameter";
501
+ case PM_ERR_EXPECT_IN_DELIMITER: return "expect_in_delimiter";
489
502
  case PM_ERR_EXPECT_LPAREN_REQ_PARAMETER: return "expect_lparen_req_parameter";
490
503
  case PM_ERR_EXPECT_MESSAGE: return "expect_message";
491
504
  case PM_ERR_EXPECT_RBRACKET: return "expect_rbracket";
@@ -525,6 +538,7 @@ pm_diagnostic_id_human(pm_diagnostic_id_t diag_id) {
525
538
  case PM_ERR_INVALID_BLOCK_EXIT: return "invalid_block_exit";
526
539
  case PM_ERR_INVALID_CHARACTER: return "invalid_character";
527
540
  case PM_ERR_INVALID_ENCODING_MAGIC_COMMENT: return "invalid_encoding_magic_comment";
541
+ case PM_ERR_INVALID_ESCAPE_CHARACTER: return "invalid_escape_character";
528
542
  case PM_ERR_INVALID_FLOAT_EXPONENT: return "invalid_float_exponent";
529
543
  case PM_ERR_INVALID_LOCAL_VARIABLE_READ: return "invalid_local_variable_read";
530
544
  case PM_ERR_INVALID_LOCAL_VARIABLE_WRITE: return "invalid_local_variable_write";
@@ -533,6 +547,7 @@ pm_diagnostic_id_human(pm_diagnostic_id_t diag_id) {
533
547
  case PM_ERR_INVALID_MULTIBYTE_ESCAPE: return "invalid_multibyte_escape";
534
548
  case PM_ERR_INVALID_NUMBER_BINARY: return "invalid_number_binary";
535
549
  case PM_ERR_INVALID_NUMBER_DECIMAL: return "invalid_number_decimal";
550
+ case PM_ERR_INVALID_NUMBER_FRACTION: return "invalid_number_fraction";
536
551
  case PM_ERR_INVALID_NUMBER_HEXADECIMAL: return "invalid_number_hexadecimal";
537
552
  case PM_ERR_INVALID_NUMBER_OCTAL: return "invalid_number_octal";
538
553
  case PM_ERR_INVALID_NUMBER_UNDERSCORE_INNER: return "invalid_number_underscore_inner";
@@ -578,6 +593,7 @@ pm_diagnostic_id_human(pm_diagnostic_id_t diag_id) {
578
593
  case PM_ERR_PARAMETER_ASSOC_SPLAT_MULTI: return "parameter_assoc_splat_multi";
579
594
  case PM_ERR_PARAMETER_BLOCK_MULTI: return "parameter_block_multi";
580
595
  case PM_ERR_PARAMETER_CIRCULAR: return "parameter_circular";
596
+ case PM_ERR_PARAMETER_FORWARDING_AFTER_REST: return "parameter_forwarding_after_rest";
581
597
  case PM_ERR_PARAMETER_METHOD_NAME: return "parameter_method_name";
582
598
  case PM_ERR_PARAMETER_NAME_DUPLICATED: return "parameter_name_duplicated";
583
599
  case PM_ERR_PARAMETER_NO_DEFAULT: return "parameter_no_default";
@@ -600,8 +616,10 @@ pm_diagnostic_id_human(pm_diagnostic_id_t diag_id) {
600
616
  case PM_ERR_PATTERN_EXPRESSION_AFTER_PIPE: return "pattern_expression_after_pipe";
601
617
  case PM_ERR_PATTERN_EXPRESSION_AFTER_RANGE: return "pattern_expression_after_range";
602
618
  case PM_ERR_PATTERN_EXPRESSION_AFTER_REST: return "pattern_expression_after_rest";
619
+ case PM_ERR_PATTERN_HASH_IMPLICIT: return "pattern_hash_implicit";
603
620
  case PM_ERR_PATTERN_HASH_KEY: return "pattern_hash_key";
604
621
  case PM_ERR_PATTERN_HASH_KEY_DUPLICATE: return "pattern_hash_key_duplicate";
622
+ case PM_ERR_PATTERN_HASH_KEY_INTERPOLATED: return "pattern_hash_key_interpolated";
605
623
  case PM_ERR_PATTERN_HASH_KEY_LABEL: return "pattern_hash_key_label";
606
624
  case PM_ERR_PATTERN_HASH_KEY_LOCALS: return "pattern_hash_key_locals";
607
625
  case PM_ERR_PATTERN_IDENT_AFTER_HROCKET: return "pattern_ident_after_hrocket";
@@ -676,6 +694,7 @@ pm_diagnostic_id_human(pm_diagnostic_id_t diag_id) {
676
694
  case PM_WARN_KEYWORD_EOL: return "keyword_eol";
677
695
  case PM_WARN_LITERAL_IN_CONDITION_DEFAULT: return "literal_in_condition_default";
678
696
  case PM_WARN_LITERAL_IN_CONDITION_VERBOSE: return "literal_in_condition_verbose";
697
+ case PM_WARN_SHAREABLE_CONSTANT_VALUE_LINE: return "shareable_constant_value_line";
679
698
  case PM_WARN_SHEBANG_CARRIAGE_RETURN: return "shebang_carriage_return";
680
699
  case PM_WARN_UNEXPECTED_CARRIAGE_RETURN: return "unexpected_carriage_return";
681
700
  case PM_WARN_UNREACHABLE_STATEMENT: return "unreachable_statement";
data/src/node.c CHANGED
@@ -5169,15 +5169,15 @@ pm_dump_json(pm_buffer_t *buffer, const pm_parser_t *parser, const pm_node_t *no
5169
5169
  pm_buffer_append_string(buffer, "\"write_name\":", 13);
5170
5170
  pm_dump_json_constant(buffer, parser, cast->write_name);
5171
5171
 
5172
- // Dump the operator field
5172
+ // Dump the binary_operator field
5173
5173
  pm_buffer_append_byte(buffer, ',');
5174
- pm_buffer_append_string(buffer, "\"operator\":", 11);
5175
- pm_dump_json_constant(buffer, parser, cast->operator);
5174
+ pm_buffer_append_string(buffer, "\"binary_operator\":", 18);
5175
+ pm_dump_json_constant(buffer, parser, cast->binary_operator);
5176
5176
 
5177
- // Dump the operator_loc field
5177
+ // Dump the binary_operator_loc field
5178
5178
  pm_buffer_append_byte(buffer, ',');
5179
- pm_buffer_append_string(buffer, "\"operator_loc\":", 15);
5180
- pm_dump_json_location(buffer, parser, &cast->operator_loc);
5179
+ pm_buffer_append_string(buffer, "\"binary_operator_loc\":", 22);
5180
+ pm_dump_json_location(buffer, parser, &cast->binary_operator_loc);
5181
5181
 
5182
5182
  // Dump the value field
5183
5183
  pm_buffer_append_byte(buffer, ',');
@@ -5561,20 +5561,20 @@ pm_dump_json(pm_buffer_t *buffer, const pm_parser_t *parser, const pm_node_t *no
5561
5561
  pm_buffer_append_string(buffer, "\"name_loc\":", 11);
5562
5562
  pm_dump_json_location(buffer, parser, &cast->name_loc);
5563
5563
 
5564
- // Dump the operator_loc field
5564
+ // Dump the binary_operator_loc field
5565
5565
  pm_buffer_append_byte(buffer, ',');
5566
- pm_buffer_append_string(buffer, "\"operator_loc\":", 15);
5567
- pm_dump_json_location(buffer, parser, &cast->operator_loc);
5566
+ pm_buffer_append_string(buffer, "\"binary_operator_loc\":", 22);
5567
+ pm_dump_json_location(buffer, parser, &cast->binary_operator_loc);
5568
5568
 
5569
5569
  // Dump the value field
5570
5570
  pm_buffer_append_byte(buffer, ',');
5571
5571
  pm_buffer_append_string(buffer, "\"value\":", 8);
5572
5572
  pm_dump_json(buffer, parser, (const pm_node_t *) cast->value);
5573
5573
 
5574
- // Dump the operator field
5574
+ // Dump the binary_operator field
5575
5575
  pm_buffer_append_byte(buffer, ',');
5576
- pm_buffer_append_string(buffer, "\"operator\":", 11);
5577
- pm_dump_json_constant(buffer, parser, cast->operator);
5576
+ pm_buffer_append_string(buffer, "\"binary_operator\":", 18);
5577
+ pm_dump_json_constant(buffer, parser, cast->binary_operator);
5578
5578
 
5579
5579
  pm_buffer_append_byte(buffer, '}');
5580
5580
  break;
@@ -5710,20 +5710,20 @@ pm_dump_json(pm_buffer_t *buffer, const pm_parser_t *parser, const pm_node_t *no
5710
5710
  pm_buffer_append_string(buffer, "\"name_loc\":", 11);
5711
5711
  pm_dump_json_location(buffer, parser, &cast->name_loc);
5712
5712
 
5713
- // Dump the operator_loc field
5713
+ // Dump the binary_operator_loc field
5714
5714
  pm_buffer_append_byte(buffer, ',');
5715
- pm_buffer_append_string(buffer, "\"operator_loc\":", 15);
5716
- pm_dump_json_location(buffer, parser, &cast->operator_loc);
5715
+ pm_buffer_append_string(buffer, "\"binary_operator_loc\":", 22);
5716
+ pm_dump_json_location(buffer, parser, &cast->binary_operator_loc);
5717
5717
 
5718
5718
  // Dump the value field
5719
5719
  pm_buffer_append_byte(buffer, ',');
5720
5720
  pm_buffer_append_string(buffer, "\"value\":", 8);
5721
5721
  pm_dump_json(buffer, parser, (const pm_node_t *) cast->value);
5722
5722
 
5723
- // Dump the operator field
5723
+ // Dump the binary_operator field
5724
5724
  pm_buffer_append_byte(buffer, ',');
5725
- pm_buffer_append_string(buffer, "\"operator\":", 11);
5726
- pm_dump_json_constant(buffer, parser, cast->operator);
5725
+ pm_buffer_append_string(buffer, "\"binary_operator\":", 18);
5726
+ pm_dump_json_constant(buffer, parser, cast->binary_operator);
5727
5727
 
5728
5728
  pm_buffer_append_byte(buffer, '}');
5729
5729
  break;
@@ -5829,20 +5829,20 @@ pm_dump_json(pm_buffer_t *buffer, const pm_parser_t *parser, const pm_node_t *no
5829
5829
  pm_buffer_append_string(buffer, "\"target\":", 9);
5830
5830
  pm_dump_json(buffer, parser, (const pm_node_t *) cast->target);
5831
5831
 
5832
- // Dump the operator_loc field
5832
+ // Dump the binary_operator_loc field
5833
5833
  pm_buffer_append_byte(buffer, ',');
5834
- pm_buffer_append_string(buffer, "\"operator_loc\":", 15);
5835
- pm_dump_json_location(buffer, parser, &cast->operator_loc);
5834
+ pm_buffer_append_string(buffer, "\"binary_operator_loc\":", 22);
5835
+ pm_dump_json_location(buffer, parser, &cast->binary_operator_loc);
5836
5836
 
5837
5837
  // Dump the value field
5838
5838
  pm_buffer_append_byte(buffer, ',');
5839
5839
  pm_buffer_append_string(buffer, "\"value\":", 8);
5840
5840
  pm_dump_json(buffer, parser, (const pm_node_t *) cast->value);
5841
5841
 
5842
- // Dump the operator field
5842
+ // Dump the binary_operator field
5843
5843
  pm_buffer_append_byte(buffer, ',');
5844
- pm_buffer_append_string(buffer, "\"operator\":", 11);
5845
- pm_dump_json_constant(buffer, parser, cast->operator);
5844
+ pm_buffer_append_string(buffer, "\"binary_operator\":", 18);
5845
+ pm_dump_json_constant(buffer, parser, cast->binary_operator);
5846
5846
 
5847
5847
  pm_buffer_append_byte(buffer, '}');
5848
5848
  break;
@@ -6499,20 +6499,20 @@ pm_dump_json(pm_buffer_t *buffer, const pm_parser_t *parser, const pm_node_t *no
6499
6499
  pm_buffer_append_string(buffer, "\"name_loc\":", 11);
6500
6500
  pm_dump_json_location(buffer, parser, &cast->name_loc);
6501
6501
 
6502
- // Dump the operator_loc field
6502
+ // Dump the binary_operator_loc field
6503
6503
  pm_buffer_append_byte(buffer, ',');
6504
- pm_buffer_append_string(buffer, "\"operator_loc\":", 15);
6505
- pm_dump_json_location(buffer, parser, &cast->operator_loc);
6504
+ pm_buffer_append_string(buffer, "\"binary_operator_loc\":", 22);
6505
+ pm_dump_json_location(buffer, parser, &cast->binary_operator_loc);
6506
6506
 
6507
6507
  // Dump the value field
6508
6508
  pm_buffer_append_byte(buffer, ',');
6509
6509
  pm_buffer_append_string(buffer, "\"value\":", 8);
6510
6510
  pm_dump_json(buffer, parser, (const pm_node_t *) cast->value);
6511
6511
 
6512
- // Dump the operator field
6512
+ // Dump the binary_operator field
6513
6513
  pm_buffer_append_byte(buffer, ',');
6514
- pm_buffer_append_string(buffer, "\"operator\":", 11);
6515
- pm_dump_json_constant(buffer, parser, cast->operator);
6514
+ pm_buffer_append_string(buffer, "\"binary_operator\":", 18);
6515
+ pm_dump_json_constant(buffer, parser, cast->binary_operator);
6516
6516
 
6517
6517
  pm_buffer_append_byte(buffer, '}');
6518
6518
  break;
@@ -6995,15 +6995,15 @@ pm_dump_json(pm_buffer_t *buffer, const pm_parser_t *parser, const pm_node_t *no
6995
6995
  pm_buffer_append_string(buffer, "null", 4);
6996
6996
  }
6997
6997
 
6998
- // Dump the operator field
6998
+ // Dump the binary_operator field
6999
6999
  pm_buffer_append_byte(buffer, ',');
7000
- pm_buffer_append_string(buffer, "\"operator\":", 11);
7001
- pm_dump_json_constant(buffer, parser, cast->operator);
7000
+ pm_buffer_append_string(buffer, "\"binary_operator\":", 18);
7001
+ pm_dump_json_constant(buffer, parser, cast->binary_operator);
7002
7002
 
7003
- // Dump the operator_loc field
7003
+ // Dump the binary_operator_loc field
7004
7004
  pm_buffer_append_byte(buffer, ',');
7005
- pm_buffer_append_string(buffer, "\"operator_loc\":", 15);
7006
- pm_dump_json_location(buffer, parser, &cast->operator_loc);
7005
+ pm_buffer_append_string(buffer, "\"binary_operator_loc\":", 22);
7006
+ pm_dump_json_location(buffer, parser, &cast->binary_operator_loc);
7007
7007
 
7008
7008
  // Dump the value field
7009
7009
  pm_buffer_append_byte(buffer, ',');
@@ -7219,20 +7219,20 @@ pm_dump_json(pm_buffer_t *buffer, const pm_parser_t *parser, const pm_node_t *no
7219
7219
  pm_buffer_append_string(buffer, "\"name_loc\":", 11);
7220
7220
  pm_dump_json_location(buffer, parser, &cast->name_loc);
7221
7221
 
7222
- // Dump the operator_loc field
7222
+ // Dump the binary_operator_loc field
7223
7223
  pm_buffer_append_byte(buffer, ',');
7224
- pm_buffer_append_string(buffer, "\"operator_loc\":", 15);
7225
- pm_dump_json_location(buffer, parser, &cast->operator_loc);
7224
+ pm_buffer_append_string(buffer, "\"binary_operator_loc\":", 22);
7225
+ pm_dump_json_location(buffer, parser, &cast->binary_operator_loc);
7226
7226
 
7227
7227
  // Dump the value field
7228
7228
  pm_buffer_append_byte(buffer, ',');
7229
7229
  pm_buffer_append_string(buffer, "\"value\":", 8);
7230
7230
  pm_dump_json(buffer, parser, (const pm_node_t *) cast->value);
7231
7231
 
7232
- // Dump the operator field
7232
+ // Dump the binary_operator field
7233
7233
  pm_buffer_append_byte(buffer, ',');
7234
- pm_buffer_append_string(buffer, "\"operator\":", 11);
7235
- pm_dump_json_constant(buffer, parser, cast->operator);
7234
+ pm_buffer_append_string(buffer, "\"binary_operator\":", 18);
7235
+ pm_dump_json_constant(buffer, parser, cast->binary_operator);
7236
7236
 
7237
7237
  pm_buffer_append_byte(buffer, '}');
7238
7238
  break;
@@ -7861,10 +7861,10 @@ pm_dump_json(pm_buffer_t *buffer, const pm_parser_t *parser, const pm_node_t *no
7861
7861
  pm_buffer_append_string(buffer, "\"name_loc\":", 11);
7862
7862
  pm_dump_json_location(buffer, parser, &cast->name_loc);
7863
7863
 
7864
- // Dump the operator_loc field
7864
+ // Dump the binary_operator_loc field
7865
7865
  pm_buffer_append_byte(buffer, ',');
7866
- pm_buffer_append_string(buffer, "\"operator_loc\":", 15);
7867
- pm_dump_json_location(buffer, parser, &cast->operator_loc);
7866
+ pm_buffer_append_string(buffer, "\"binary_operator_loc\":", 22);
7867
+ pm_dump_json_location(buffer, parser, &cast->binary_operator_loc);
7868
7868
 
7869
7869
  // Dump the value field
7870
7870
  pm_buffer_append_byte(buffer, ',');
@@ -7876,10 +7876,10 @@ pm_dump_json(pm_buffer_t *buffer, const pm_parser_t *parser, const pm_node_t *no
7876
7876
  pm_buffer_append_string(buffer, "\"name\":", 7);
7877
7877
  pm_dump_json_constant(buffer, parser, cast->name);
7878
7878
 
7879
- // Dump the operator field
7879
+ // Dump the binary_operator field
7880
7880
  pm_buffer_append_byte(buffer, ',');
7881
- pm_buffer_append_string(buffer, "\"operator\":", 11);
7882
- pm_dump_json_constant(buffer, parser, cast->operator);
7881
+ pm_buffer_append_string(buffer, "\"binary_operator\":", 18);
7882
+ pm_dump_json_constant(buffer, parser, cast->binary_operator);
7883
7883
 
7884
7884
  // Dump the depth field
7885
7885
  pm_buffer_append_byte(buffer, ',');