[ruby/prism] Handle parsing a line break in a receiver of a method
https://github.com/ruby/prism/commit/4d5f43ecbc
This commit is contained in:
parent
b3d6128049
commit
d1d50a0505
@ -15003,6 +15003,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b
|
||||
pm_token_t lparen = parser->previous;
|
||||
pm_node_t *expression = parse_value_expression(parser, PM_BINDING_POWER_STATEMENT, true, PM_ERR_DEF_RECEIVER);
|
||||
|
||||
accept1(parser, PM_TOKEN_NEWLINE);
|
||||
expect1(parser, PM_TOKEN_PARENTHESIS_RIGHT, PM_ERR_EXPECT_RPAREN);
|
||||
pm_token_t rparen = parser->previous;
|
||||
|
||||
|
@ -335,10 +335,10 @@ module Prism
|
||||
|
||||
def test_def_with_multiple_statements_receiver
|
||||
assert_errors expression("def (\na\nb\n).c; end"), "def (\na\nb\n).c; end", [
|
||||
["expected a matching `)`", 7..7],
|
||||
["expected a `.` or `::` after the receiver in a method definition", 7..7],
|
||||
["expected a method name", 7..7],
|
||||
["cannot parse the expression", 10..10],
|
||||
["expected a matching `)`", 8..8],
|
||||
["expected a `.` or `::` after the receiver in a method definition", 8..8],
|
||||
["expected a delimiter to close the parameters", 9..9],
|
||||
["cannot parse the expression", 9..9],
|
||||
["cannot parse the expression", 11..11]
|
||||
]
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user