Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ errors:
- PARAMETER_UNEXPECTED_FWD
- PARAMETER_UNEXPECTED_NO_KW
- PARAMETER_WILD_LOOSE_COMMA
- PATTERN_ALTERNATIVE_AFTER_CAPTURE
- PATTERN_ARRAY_MULTIPLE_RESTS
- PATTERN_CAPTURE_DUPLICATE
- PATTERN_CAPTURE_IN_ALTERNATIVE
Expand Down
113 changes: 60 additions & 53 deletions src/prism.c

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion templates/src/diagnostic.c.erb
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@ static const pm_diagnostic_data_t diagnostic_messages[PM_DIAGNOSTIC_ID_MAX] = {
[PM_ERR_PARAMETER_UNEXPECTED_FWD] = { "unexpected `...` in parameters", PM_ERROR_LEVEL_SYNTAX },
[PM_ERR_PARAMETER_WILD_LOOSE_COMMA] = { "unexpected `,` in parameters", PM_ERROR_LEVEL_SYNTAX },
[PM_ERR_PARAMETER_UNEXPECTED_NO_KW] = { "unexpected **nil; no keywords marker disallowed after keywords", PM_ERROR_LEVEL_SYNTAX },
[PM_ERR_PATTERN_ALTERNATIVE_AFTER_CAPTURE] = { "alternative pattern after variable capture", PM_ERROR_LEVEL_SYNTAX },
[PM_ERR_PATTERN_ARRAY_MULTIPLE_RESTS] = { "unexpected multiple '*' rest patterns in an array pattern", PM_ERROR_LEVEL_SYNTAX },
[PM_ERR_PATTERN_CAPTURE_DUPLICATE] = { "duplicated variable name", PM_ERROR_LEVEL_SYNTAX },
[PM_ERR_PATTERN_CAPTURE_IN_ALTERNATIVE] = { "variable capture in alternative pattern", PM_ERROR_LEVEL_SYNTAX },
Expand Down
4 changes: 4 additions & 0 deletions test/prism/errors/pattern-capture-in-alt-array.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
1 => [a, b] | 2
^ variable capture in alternative pattern
^ variable capture in alternative pattern

3 changes: 3 additions & 0 deletions test/prism/errors/pattern-capture-in-alt-hash.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
1 => { a: b } | 2
^ variable capture in alternative pattern

3 changes: 3 additions & 0 deletions test/prism/errors/pattern-capture-in-alt-name.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
1 => (2 => b) | 2
^ variable capture in alternative pattern

4 changes: 4 additions & 0 deletions test/prism/errors/pattern-capture-in-alt-top.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
1 => a | b
^ variable capture in alternative pattern
^ variable capture in alternative pattern

Loading