[ruby/prism] Change forwarding error messages to match CRuby
https://github.com/ruby/prism/commit/6a15e475c9
This commit is contained in:
parent
2ecf269e68
commit
440c63df31
@ -100,9 +100,9 @@ static const pm_diagnostic_data_t diagnostic_messages[PM_DIAGNOSTIC_ID_MAX] = {
|
||||
[PM_ERR_ARGUMENT_FORWARDING_UNBOUND] = { "unexpected `...` in an non-parenthesized call", PM_ERROR_LEVEL_SYNTAX },
|
||||
[PM_ERR_ARGUMENT_IN] = { "unexpected `in` keyword in arguments", PM_ERROR_LEVEL_SYNTAX },
|
||||
[PM_ERR_ARGUMENT_NO_FORWARDING_AMP] = { "unexpected `&` when the parent method is not forwarding", PM_ERROR_LEVEL_SYNTAX },
|
||||
[PM_ERR_ARGUMENT_NO_FORWARDING_ELLIPSES] = { "unexpected `...` when the parent method is not forwarding", PM_ERROR_LEVEL_SYNTAX },
|
||||
[PM_ERR_ARGUMENT_NO_FORWARDING_STAR] = { "unexpected `*` when the parent method is not forwarding", PM_ERROR_LEVEL_SYNTAX },
|
||||
[PM_ERR_ARGUMENT_NO_FORWARDING_STAR_STAR] = { "unexpected `**` when the parent method is not forwarding", PM_ERROR_LEVEL_SYNTAX },
|
||||
[PM_ERR_ARGUMENT_NO_FORWARDING_ELLIPSES] = { "unexpected ... when the parent method is not forwarding", PM_ERROR_LEVEL_SYNTAX },
|
||||
[PM_ERR_ARGUMENT_NO_FORWARDING_STAR] = { "unexpected `*`; no anonymous rest parameter", PM_ERROR_LEVEL_SYNTAX },
|
||||
[PM_ERR_ARGUMENT_NO_FORWARDING_STAR_STAR] = { "unexpected `**`; no anonymous keyword rest parameter", PM_ERROR_LEVEL_SYNTAX },
|
||||
[PM_ERR_ARGUMENT_SPLAT_AFTER_ASSOC_SPLAT] = { "unexpected `*` splat argument after a `**` keyword splat argument", PM_ERROR_LEVEL_SYNTAX },
|
||||
[PM_ERR_ARGUMENT_SPLAT_AFTER_SPLAT] = { "unexpected `*` splat argument after a `*` splat argument", PM_ERROR_LEVEL_SYNTAX },
|
||||
[PM_ERR_ARGUMENT_TERM_PAREN] = { "expected a `)` to close the arguments", PM_ERROR_LEVEL_SYNTAX },
|
||||
|
@ -290,14 +290,14 @@ module Prism
|
||||
|
||||
def test_argument_forwarding_when_parent_is_not_forwarding
|
||||
assert_errors expression('def a(x, y, z); b(...); end'), 'def a(x, y, z); b(...); end', [
|
||||
["unexpected `...` when the parent method is not forwarding", 18..21]
|
||||
["unexpected ... when the parent method is not forwarding", 18..21]
|
||||
]
|
||||
end
|
||||
|
||||
def test_argument_forwarding_only_effects_its_own_internals
|
||||
assert_errors expression('def a(...); b(...); end; def c(x, y, z); b(...); end'),
|
||||
'def a(...); b(...); end; def c(x, y, z); b(...); end', [
|
||||
["unexpected `...` when the parent method is not forwarding", 43..46]
|
||||
["unexpected ... when the parent method is not forwarding", 43..46]
|
||||
]
|
||||
end
|
||||
|
||||
@ -1054,7 +1054,7 @@ module Prism
|
||||
)
|
||||
|
||||
assert_errors expected, "->(...) {}", [
|
||||
["unexpected `...` when the parent method is not forwarding", 3..6]
|
||||
["unexpected ... when the parent method is not forwarding", 3..6]
|
||||
]
|
||||
end
|
||||
|
||||
@ -1078,7 +1078,7 @@ module Prism
|
||||
)
|
||||
|
||||
assert_errors expected, "a {|...|}", [
|
||||
["unexpected `...` when the parent method is not forwarding", 4..7]
|
||||
["unexpected ... when the parent method is not forwarding", 4..7]
|
||||
]
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user