prism 1.4.0 → 1.7.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 +73 -1
- data/Makefile +7 -5
- data/README.md +3 -1
- data/config.yml +294 -41
- data/docs/build_system.md +2 -2
- data/docs/cruby_compilation.md +1 -1
- data/docs/design.md +2 -2
- data/docs/parser_translation.md +8 -23
- data/docs/releasing.md +6 -25
- data/docs/ripper_translation.md +1 -1
- data/ext/prism/api_node.c +9 -3
- data/ext/prism/extconf.rb +1 -1
- data/ext/prism/extension.c +24 -3
- data/ext/prism/extension.h +1 -1
- data/include/prism/ast.h +360 -70
- data/include/prism/diagnostic.h +7 -0
- data/include/prism/options.h +49 -3
- data/include/prism/parser.h +3 -0
- data/include/prism/regexp.h +2 -2
- data/include/prism/util/pm_buffer.h +8 -0
- data/include/prism/util/pm_integer.h +4 -0
- data/include/prism/util/pm_list.h +6 -0
- data/include/prism/util/pm_string.h +12 -2
- data/include/prism/version.h +2 -2
- data/include/prism.h +40 -15
- data/lib/prism/compiler.rb +456 -151
- data/lib/prism/desugar_compiler.rb +1 -0
- data/lib/prism/dispatcher.rb +16 -0
- data/lib/prism/dot_visitor.rb +10 -1
- data/lib/prism/dsl.rb +5 -2
- data/lib/prism/ffi.rb +28 -10
- data/lib/prism/inspect_visitor.rb +4 -0
- data/lib/prism/lex_compat.rb +1 -0
- data/lib/prism/mutation_compiler.rb +3 -0
- data/lib/prism/node.rb +559 -349
- data/lib/prism/node_ext.rb +4 -1
- data/lib/prism/pack.rb +2 -0
- data/lib/prism/parse_result/comments.rb +1 -0
- data/lib/prism/parse_result/errors.rb +1 -0
- data/lib/prism/parse_result/newlines.rb +1 -0
- data/lib/prism/parse_result.rb +3 -15
- data/lib/prism/pattern.rb +1 -0
- data/lib/prism/polyfill/scan_byte.rb +14 -0
- data/lib/prism/polyfill/warn.rb +36 -0
- data/lib/prism/reflection.rb +4 -1
- data/lib/prism/relocation.rb +1 -0
- data/lib/prism/serialize.rb +30 -22
- data/lib/prism/string_query.rb +1 -0
- data/lib/prism/translation/parser/builder.rb +1 -0
- data/lib/prism/translation/parser/compiler.rb +63 -41
- data/lib/prism/translation/parser/lexer.rb +29 -21
- data/lib/prism/translation/parser.rb +25 -4
- data/lib/prism/translation/parser33.rb +1 -0
- data/lib/prism/translation/parser34.rb +1 -0
- data/lib/prism/translation/parser35.rb +2 -6
- data/lib/prism/translation/parser40.rb +13 -0
- data/lib/prism/translation/parser41.rb +13 -0
- data/lib/prism/translation/parser_current.rb +26 -0
- data/lib/prism/translation/ripper/sexp.rb +1 -0
- data/lib/prism/translation/ripper.rb +19 -3
- data/lib/prism/translation/ruby_parser.rb +340 -22
- data/lib/prism/translation.rb +4 -0
- data/lib/prism/visitor.rb +457 -152
- data/lib/prism.rb +22 -0
- data/prism.gemspec +9 -1
- data/rbi/prism/dsl.rbi +6 -6
- data/rbi/prism/node.rbi +42 -17
- data/rbi/prism/translation/parser35.rbi +0 -2
- data/rbi/prism/translation/parser40.rbi +6 -0
- data/rbi/prism/translation/parser41.rbi +6 -0
- data/sig/prism/dispatcher.rbs +3 -0
- data/sig/prism/dsl.rbs +5 -5
- data/sig/prism/node.rbs +462 -38
- data/sig/prism/node_ext.rbs +84 -17
- data/sig/prism/parse_result/comments.rbs +38 -0
- data/sig/prism/parse_result.rbs +4 -0
- data/sig/prism/reflection.rbs +1 -1
- data/sig/prism.rbs +4 -0
- data/src/diagnostic.c +13 -1
- data/src/encoding.c +172 -67
- data/src/node.c +11 -0
- data/src/options.c +17 -7
- data/src/prettyprint.c +18 -0
- data/src/prism.c +1495 -2021
- data/src/serialize.c +9 -1
- data/src/token_type.c +38 -36
- data/src/util/pm_constant_pool.c +1 -1
- data/src/util/pm_string.c +6 -8
- metadata +11 -3
data/sig/prism/node_ext.rbs
CHANGED
|
@@ -1,46 +1,40 @@
|
|
|
1
1
|
module Prism
|
|
2
|
+
class Node
|
|
3
|
+
def deprecated: (*String replacements) -> void
|
|
4
|
+
end
|
|
5
|
+
|
|
2
6
|
class InterpolatedMatchLastLineNode < Node
|
|
3
|
-
# Returns a numeric value that represents the flags that were used to create
|
|
4
|
-
# the regular expression.
|
|
5
7
|
def options: () -> Integer
|
|
6
8
|
end
|
|
7
9
|
|
|
8
10
|
class InterpolatedRegularExpressionNode < Node
|
|
9
|
-
# Returns a numeric value that represents the flags that were used to create
|
|
10
|
-
# the regular expression.
|
|
11
11
|
def options: () -> Integer
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
class MatchLastLineNode < Node
|
|
15
|
-
# Returns a numeric value that represents the flags that were used to create
|
|
16
|
-
# the regular expression.
|
|
17
15
|
def options: () -> Integer
|
|
18
16
|
end
|
|
19
17
|
|
|
20
18
|
class RegularExpressionNode < Node
|
|
21
|
-
# Returns a numeric value that represents the flags that were used to create
|
|
22
|
-
# the regular expression.
|
|
23
19
|
def options: () -> Integer
|
|
24
20
|
end
|
|
25
21
|
|
|
26
22
|
class InterpolatedStringNode < Node
|
|
27
|
-
|
|
28
|
-
def heredoc?: () -> bool?
|
|
23
|
+
def heredoc?: () -> bool
|
|
29
24
|
end
|
|
30
25
|
|
|
31
26
|
class InterpolatedXStringNode < Node
|
|
32
|
-
|
|
33
|
-
def heredoc?: () -> bool?
|
|
27
|
+
def heredoc?: () -> bool
|
|
34
28
|
end
|
|
35
29
|
|
|
36
30
|
class StringNode < Node
|
|
37
|
-
|
|
38
|
-
def
|
|
31
|
+
def heredoc?: () -> bool
|
|
32
|
+
def to_interpolated: () -> InterpolatedStringNode
|
|
39
33
|
end
|
|
40
34
|
|
|
41
35
|
class XStringNode < Node
|
|
42
|
-
|
|
43
|
-
def
|
|
36
|
+
def heredoc?: () -> bool
|
|
37
|
+
def to_interpolated: () -> InterpolatedXStringNode
|
|
44
38
|
end
|
|
45
39
|
|
|
46
40
|
class ImaginaryNode < Node
|
|
@@ -49,10 +43,16 @@ module Prism
|
|
|
49
43
|
|
|
50
44
|
class RationalNode < Node
|
|
51
45
|
def value: () -> Rational
|
|
46
|
+
def numeric: () -> (IntegerNode | FloatNode)
|
|
52
47
|
end
|
|
53
48
|
|
|
54
49
|
class ConstantReadNode < Node
|
|
55
|
-
def full_name_parts: () -> [Symbol]
|
|
50
|
+
def full_name_parts: () -> Array[Symbol]
|
|
51
|
+
def full_name: () -> String
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
class ConstantWriteNode < Node
|
|
55
|
+
def full_name_parts: () -> Array[Symbol]
|
|
56
56
|
def full_name: () -> String
|
|
57
57
|
end
|
|
58
58
|
|
|
@@ -65,11 +65,18 @@ module Prism
|
|
|
65
65
|
|
|
66
66
|
def full_name_parts: () -> Array[Symbol]
|
|
67
67
|
def full_name: () -> String
|
|
68
|
+
def child: () -> (ConstantReadNode | MissingNode)
|
|
68
69
|
end
|
|
69
70
|
|
|
70
71
|
class ConstantPathTargetNode < Node
|
|
71
72
|
def full_name_parts: () -> Array[Symbol]
|
|
72
73
|
def full_name: () -> String
|
|
74
|
+
def child: () -> (ConstantReadNode | MissingNode)
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
class ConstantTargetNode < Node
|
|
78
|
+
def full_name_parts: () -> Array[Symbol]
|
|
79
|
+
def full_name: () -> String
|
|
73
80
|
end
|
|
74
81
|
|
|
75
82
|
class ParametersNode < Node
|
|
@@ -79,4 +86,64 @@ module Prism
|
|
|
79
86
|
class CallNode < Node
|
|
80
87
|
def full_message_loc: () -> Location?
|
|
81
88
|
end
|
|
89
|
+
|
|
90
|
+
class CallOperatorWriteNode < Node
|
|
91
|
+
def operator: () -> Symbol
|
|
92
|
+
def operator_loc: () -> Location
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
class ClassVariableOperatorWriteNode < Node
|
|
96
|
+
def operator: () -> Symbol
|
|
97
|
+
def operator_loc: () -> Location
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
class ConstantOperatorWriteNode < Node
|
|
101
|
+
def operator: () -> Symbol
|
|
102
|
+
def operator_loc: () -> Location
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
class ConstantPathOperatorWriteNode < Node
|
|
106
|
+
def operator: () -> Symbol
|
|
107
|
+
def operator_loc: () -> Location
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
class GlobalVariableOperatorWriteNode < Node
|
|
111
|
+
def operator: () -> Symbol
|
|
112
|
+
def operator_loc: () -> Location
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
class IndexOperatorWriteNode < Node
|
|
116
|
+
def operator: () -> Symbol
|
|
117
|
+
def operator_loc: () -> Location
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
class InstanceVariableOperatorWriteNode < Node
|
|
121
|
+
def operator: () -> Symbol
|
|
122
|
+
def operator_loc: () -> Location
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
class LocalVariableOperatorWriteNode < Node
|
|
126
|
+
def operator: () -> Symbol
|
|
127
|
+
def operator_loc: () -> Location
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
class CaseMatchNode < Node
|
|
131
|
+
def consequent: () -> ElseNode?
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
class CaseNode < Node
|
|
135
|
+
def consequent: () -> ElseNode?
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
class IfNode < Node
|
|
139
|
+
def consequent: () -> (ElseNode | IfNode | nil)
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
class RescueNode < Node
|
|
143
|
+
def consequent: () -> RescueNode?
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
class UnlessNode < Node
|
|
147
|
+
def consequent: () -> ElseNode?
|
|
148
|
+
end
|
|
82
149
|
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
module Prism
|
|
2
|
+
class ParseResult < Result
|
|
3
|
+
class Comments
|
|
4
|
+
interface _Target
|
|
5
|
+
def start_offset: () -> Integer
|
|
6
|
+
def end_offset: () -> Integer
|
|
7
|
+
def encloses?: (comment) -> bool
|
|
8
|
+
def leading_comment: (comment) -> void
|
|
9
|
+
def trailing_comment: (comment) -> void
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
class NodeTarget
|
|
13
|
+
include _Target
|
|
14
|
+
|
|
15
|
+
attr_reader node: node
|
|
16
|
+
|
|
17
|
+
def initialize: (node) -> void
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
class LocationTarget
|
|
21
|
+
include _Target
|
|
22
|
+
|
|
23
|
+
attr_reader location: Location
|
|
24
|
+
|
|
25
|
+
def initialize: (Location location) -> void
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
attr_reader parse_result: ParseResult
|
|
29
|
+
|
|
30
|
+
def initialize: (ParseResult parse_result) -> void
|
|
31
|
+
def attach!: () -> void
|
|
32
|
+
|
|
33
|
+
private
|
|
34
|
+
|
|
35
|
+
def nearest_targets: (node, comment) -> [_Target?, _Target, _Target?]
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
data/sig/prism/parse_result.rbs
CHANGED
|
@@ -24,6 +24,7 @@ module Prism
|
|
|
24
24
|
def code_units_offset: (Integer byte_offset, Encoding encoding) -> Integer
|
|
25
25
|
def code_units_cache: (Encoding encoding) -> _CodeUnitsCache
|
|
26
26
|
def code_units_column: (Integer byte_offset, Encoding encoding) -> Integer
|
|
27
|
+
def deep_freeze: () -> void
|
|
27
28
|
|
|
28
29
|
def self.for: (String source) -> Source
|
|
29
30
|
end
|
|
@@ -145,6 +146,7 @@ module Prism
|
|
|
145
146
|
|
|
146
147
|
def initialize: (Array[comment] comments, Array[MagicComment] magic_comments, Location? data_loc, Array[ParseError] errors, Array[ParseWarning] warnings, Source source) -> void
|
|
147
148
|
def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped]
|
|
149
|
+
def encoding: () -> Encoding
|
|
148
150
|
def success?: () -> bool
|
|
149
151
|
def failure?: () -> bool
|
|
150
152
|
def code_units_cache: (Encoding encoding) -> _CodeUnitsCache
|
|
@@ -155,6 +157,7 @@ module Prism
|
|
|
155
157
|
|
|
156
158
|
def initialize: (ProgramNode value, Array[comment] comments, Array[MagicComment] magic_comments, Location? data_loc, Array[ParseError] errors, Array[ParseWarning] warnings, Source source) -> void
|
|
157
159
|
def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped]
|
|
160
|
+
def errors_format: () -> String
|
|
158
161
|
end
|
|
159
162
|
|
|
160
163
|
class LexResult < Result
|
|
@@ -181,6 +184,7 @@ module Prism
|
|
|
181
184
|
def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped]
|
|
182
185
|
def pretty_print: (untyped q) -> untyped
|
|
183
186
|
def ==: (untyped other) -> bool
|
|
187
|
+
def deep_freeze: () -> void
|
|
184
188
|
end
|
|
185
189
|
|
|
186
190
|
class Scope
|
data/sig/prism/reflection.rbs
CHANGED
data/sig/prism.rbs
CHANGED
data/src/diagnostic.c
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* :markup: markdown */
|
|
2
|
+
|
|
1
3
|
/*----------------------------------------------------------------------------*/
|
|
2
4
|
/* This file is generated by the templates/template.rb script and should not */
|
|
3
5
|
/* be modified manually. See */
|
|
@@ -8,7 +10,7 @@
|
|
|
8
10
|
|
|
9
11
|
#include "prism/diagnostic.h"
|
|
10
12
|
|
|
11
|
-
#define PM_DIAGNOSTIC_ID_MAX
|
|
13
|
+
#define PM_DIAGNOSTIC_ID_MAX 324
|
|
12
14
|
|
|
13
15
|
/** This struct holds the data for each diagnostic. */
|
|
14
16
|
typedef struct {
|
|
@@ -152,6 +154,7 @@ static const pm_diagnostic_data_t diagnostic_messages[PM_DIAGNOSTIC_ID_MAX] = {
|
|
|
152
154
|
[PM_ERR_CONDITIONAL_WHILE_PREDICATE] = { "expected a predicate expression for the `while` statement", PM_ERROR_LEVEL_SYNTAX },
|
|
153
155
|
[PM_ERR_CONSTANT_PATH_COLON_COLON_CONSTANT] = { "expected a constant after the `::` operator", PM_ERROR_LEVEL_SYNTAX },
|
|
154
156
|
[PM_ERR_DEF_ENDLESS] = { "could not parse the endless method body", PM_ERROR_LEVEL_SYNTAX },
|
|
157
|
+
[PM_ERR_DEF_ENDLESS_PARAMETERS] = { "could not parse the endless method parameters", PM_ERROR_LEVEL_SYNTAX },
|
|
155
158
|
[PM_ERR_DEF_ENDLESS_SETTER] = { "invalid method name; a setter method cannot be defined in an endless method definition", PM_ERROR_LEVEL_SYNTAX },
|
|
156
159
|
[PM_ERR_DEF_NAME] = { "unexpected %s; expected a method name", PM_ERROR_LEVEL_SYNTAX },
|
|
157
160
|
[PM_ERR_DEF_PARAMS_TERM] = { "expected a delimiter to close the parameters", PM_ERROR_LEVEL_SYNTAX },
|
|
@@ -192,6 +195,8 @@ static const pm_diagnostic_data_t diagnostic_messages[PM_DIAGNOSTIC_ID_MAX] = {
|
|
|
192
195
|
[PM_ERR_EXPECT_FOR_DELIMITER] = { "unexpected %s; expected a 'do', newline, or ';' after the 'for' loop collection", PM_ERROR_LEVEL_SYNTAX },
|
|
193
196
|
[PM_ERR_EXPECT_IDENT_REQ_PARAMETER] = { "expected an identifier for the required parameter", PM_ERROR_LEVEL_SYNTAX },
|
|
194
197
|
[PM_ERR_EXPECT_IN_DELIMITER] = { "expected a delimiter after the patterns of an `in` clause", PM_ERROR_LEVEL_SYNTAX },
|
|
198
|
+
[PM_ERR_EXPECT_LPAREN_AFTER_NOT_LPAREN] = { "expected a `(` immediately after `not`", PM_ERROR_LEVEL_SYNTAX },
|
|
199
|
+
[PM_ERR_EXPECT_LPAREN_AFTER_NOT_OTHER] = { "expected a `(` after `not`", PM_ERROR_LEVEL_SYNTAX },
|
|
195
200
|
[PM_ERR_EXPECT_LPAREN_REQ_PARAMETER] = { "expected a `(` to start a required parameter", PM_ERROR_LEVEL_SYNTAX },
|
|
196
201
|
[PM_ERR_EXPECT_MESSAGE] = { "unexpected %s; expecting a message to send to the receiver", PM_ERROR_LEVEL_SYNTAX },
|
|
197
202
|
[PM_ERR_EXPECT_RBRACKET] = { "expected a matching `]`", PM_ERROR_LEVEL_SYNTAX },
|
|
@@ -306,6 +311,7 @@ static const pm_diagnostic_data_t diagnostic_messages[PM_DIAGNOSTIC_ID_MAX] = {
|
|
|
306
311
|
[PM_ERR_PARAMETER_UNEXPECTED_NO_KW] = { "unexpected **nil; no keywords marker disallowed after keywords", PM_ERROR_LEVEL_SYNTAX },
|
|
307
312
|
[PM_ERR_PATTERN_ARRAY_MULTIPLE_RESTS] = { "unexpected multiple '*' rest patterns in an array pattern", PM_ERROR_LEVEL_SYNTAX },
|
|
308
313
|
[PM_ERR_PATTERN_CAPTURE_DUPLICATE] = { "duplicated variable name", PM_ERROR_LEVEL_SYNTAX },
|
|
314
|
+
[PM_ERR_PATTERN_CAPTURE_IN_ALTERNATIVE] = { "variable capture in alternative pattern", PM_ERROR_LEVEL_SYNTAX },
|
|
309
315
|
[PM_ERR_PATTERN_EXPRESSION_AFTER_BRACKET] = { "expected a pattern expression after the `[` operator", PM_ERROR_LEVEL_SYNTAX },
|
|
310
316
|
[PM_ERR_PATTERN_EXPRESSION_AFTER_COMMA] = { "expected a pattern expression after `,`", PM_ERROR_LEVEL_SYNTAX },
|
|
311
317
|
[PM_ERR_PATTERN_EXPRESSION_AFTER_HROCKET] = { "expected a pattern expression after `=>`", PM_ERROR_LEVEL_SYNTAX },
|
|
@@ -366,6 +372,7 @@ static const pm_diagnostic_data_t diagnostic_messages[PM_DIAGNOSTIC_ID_MAX] = {
|
|
|
366
372
|
[PM_ERR_UNEXPECTED_INDEX_KEYWORDS] = { "unexpected keyword arg given in index assignment; keywords are not allowed in index assignment expressions", PM_ERROR_LEVEL_SYNTAX },
|
|
367
373
|
[PM_ERR_UNEXPECTED_LABEL] = { "unexpected label", PM_ERROR_LEVEL_SYNTAX },
|
|
368
374
|
[PM_ERR_UNEXPECTED_MULTI_WRITE] = { "unexpected multiple assignment; multiple assignment is not allowed in this context", PM_ERROR_LEVEL_SYNTAX },
|
|
375
|
+
[PM_ERR_UNEXPECTED_PARAMETER_DEFAULT_VALUE] = { "unexpected %s; expected a default value for a parameter", PM_ERROR_LEVEL_SYNTAX },
|
|
369
376
|
[PM_ERR_UNEXPECTED_RANGE_OPERATOR] = { "unexpected range operator; .. and ... are non-associative and cannot be chained", PM_ERROR_LEVEL_SYNTAX },
|
|
370
377
|
[PM_ERR_UNEXPECTED_SAFE_NAVIGATION] = { "&. inside multiple assignment destination", PM_ERROR_LEVEL_SYNTAX },
|
|
371
378
|
[PM_ERR_UNEXPECTED_TOKEN_CLOSE_CONTEXT] = { "unexpected %s, assuming it is closing the parent %s", PM_ERROR_LEVEL_SYNTAX },
|
|
@@ -478,6 +485,7 @@ pm_diagnostic_id_human(pm_diagnostic_id_t diag_id) {
|
|
|
478
485
|
case PM_ERR_CONDITIONAL_WHILE_PREDICATE: return "conditional_while_predicate";
|
|
479
486
|
case PM_ERR_CONSTANT_PATH_COLON_COLON_CONSTANT: return "constant_path_colon_colon_constant";
|
|
480
487
|
case PM_ERR_DEF_ENDLESS: return "def_endless";
|
|
488
|
+
case PM_ERR_DEF_ENDLESS_PARAMETERS: return "def_endless_parameters";
|
|
481
489
|
case PM_ERR_DEF_ENDLESS_SETTER: return "def_endless_setter";
|
|
482
490
|
case PM_ERR_DEF_NAME: return "def_name";
|
|
483
491
|
case PM_ERR_DEF_PARAMS_TERM: return "def_params_term";
|
|
@@ -519,6 +527,8 @@ pm_diagnostic_id_human(pm_diagnostic_id_t diag_id) {
|
|
|
519
527
|
case PM_ERR_EXPECT_FOR_DELIMITER: return "expect_for_delimiter";
|
|
520
528
|
case PM_ERR_EXPECT_IDENT_REQ_PARAMETER: return "expect_ident_req_parameter";
|
|
521
529
|
case PM_ERR_EXPECT_IN_DELIMITER: return "expect_in_delimiter";
|
|
530
|
+
case PM_ERR_EXPECT_LPAREN_AFTER_NOT_LPAREN: return "expect_lparen_after_not_lparen";
|
|
531
|
+
case PM_ERR_EXPECT_LPAREN_AFTER_NOT_OTHER: return "expect_lparen_after_not_other";
|
|
522
532
|
case PM_ERR_EXPECT_LPAREN_REQ_PARAMETER: return "expect_lparen_req_parameter";
|
|
523
533
|
case PM_ERR_EXPECT_MESSAGE: return "expect_message";
|
|
524
534
|
case PM_ERR_EXPECT_RBRACKET: return "expect_rbracket";
|
|
@@ -634,6 +644,7 @@ pm_diagnostic_id_human(pm_diagnostic_id_t diag_id) {
|
|
|
634
644
|
case PM_ERR_PARAMETER_WILD_LOOSE_COMMA: return "parameter_wild_loose_comma";
|
|
635
645
|
case PM_ERR_PATTERN_ARRAY_MULTIPLE_RESTS: return "pattern_array_multiple_rests";
|
|
636
646
|
case PM_ERR_PATTERN_CAPTURE_DUPLICATE: return "pattern_capture_duplicate";
|
|
647
|
+
case PM_ERR_PATTERN_CAPTURE_IN_ALTERNATIVE: return "pattern_capture_in_alternative";
|
|
637
648
|
case PM_ERR_PATTERN_EXPRESSION_AFTER_BRACKET: return "pattern_expression_after_bracket";
|
|
638
649
|
case PM_ERR_PATTERN_EXPRESSION_AFTER_COMMA: return "pattern_expression_after_comma";
|
|
639
650
|
case PM_ERR_PATTERN_EXPRESSION_AFTER_HROCKET: return "pattern_expression_after_hrocket";
|
|
@@ -695,6 +706,7 @@ pm_diagnostic_id_human(pm_diagnostic_id_t diag_id) {
|
|
|
695
706
|
case PM_ERR_UNEXPECTED_INDEX_KEYWORDS: return "unexpected_index_keywords";
|
|
696
707
|
case PM_ERR_UNEXPECTED_LABEL: return "unexpected_label";
|
|
697
708
|
case PM_ERR_UNEXPECTED_MULTI_WRITE: return "unexpected_multi_write";
|
|
709
|
+
case PM_ERR_UNEXPECTED_PARAMETER_DEFAULT_VALUE: return "unexpected_parameter_default_value";
|
|
698
710
|
case PM_ERR_UNEXPECTED_RANGE_OPERATOR: return "unexpected_range_operator";
|
|
699
711
|
case PM_ERR_UNEXPECTED_SAFE_NAVIGATION: return "unexpected_safe_navigation";
|
|
700
712
|
case PM_ERR_UNEXPECTED_TOKEN_CLOSE_CONTEXT: return "unexpected_token_close_context";
|