зеркало из https://github.com/github/ruby.git
[ruby/prism] Check void values in singleton class (`class <<`)
Follow up the ruby/ruby#8917 change. https://github.com/ruby/prism/commit/f6bac4d3bf
This commit is contained in:
Родитель
1f06d168ba
Коммит
6968b289e7
|
@ -14546,7 +14546,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power) {
|
|||
|
||||
if (accept1(parser, PM_TOKEN_LESS_LESS)) {
|
||||
pm_token_t operator = parser->previous;
|
||||
pm_node_t *expression = parse_expression(parser, PM_BINDING_POWER_NOT, PM_ERR_EXPECT_EXPRESSION_AFTER_LESS_LESS);
|
||||
pm_node_t *expression = parse_value_expression(parser, PM_BINDING_POWER_NOT, PM_ERR_EXPECT_EXPRESSION_AFTER_LESS_LESS);
|
||||
|
||||
pm_parser_scope_push(parser, true);
|
||||
accept2(parser, PM_TOKEN_NEWLINE, PM_TOKEN_SEMICOLON);
|
||||
|
|
|
@ -1508,6 +1508,8 @@ module Prism
|
|||
end
|
||||
class A < (return)
|
||||
end
|
||||
class << (return)
|
||||
end
|
||||
for x in (return)
|
||||
end
|
||||
RUBY
|
||||
|
@ -1520,6 +1522,7 @@ module Prism
|
|||
[message, 80..86],
|
||||
[message, 110..116],
|
||||
[message, 132..138],
|
||||
[message, 154..160],
|
||||
], compare_ripper: false # Ripper does not check 'void value expression'.
|
||||
end
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче