mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Continue to the next line beginning with a pipeline
This commit is contained in:
parent
043f010c28
commit
aa7211836b
2 changed files with 3 additions and 1 deletions
3
parse.y
3
parse.y
|
@ -8678,10 +8678,11 @@ parser_yylex(struct parser_params *p)
|
|||
case '\13': /* '\v' */
|
||||
space_seen = 1;
|
||||
break;
|
||||
case '|':
|
||||
case '&':
|
||||
case '.': {
|
||||
dispatch_delayed_token(p, tIGNORED_NL);
|
||||
if (peek(p, '.') == (c == '&')) {
|
||||
if (c == '|' ? peek(p, '>') : (peek(p, '.') == (c == '&'))) {
|
||||
pushback(p, c);
|
||||
dispatch_scan_event(p, tSP);
|
||||
goto retry;
|
||||
|
|
|
@ -1384,6 +1384,7 @@ eom
|
|||
x = nil
|
||||
assert_equal("121", eval('x = 12 |> pow(2) |> to_s 11'))
|
||||
assert_equal(12, x)
|
||||
assert_equal([2, 4, 6], eval("1.. |> take 3\n|> map do @1 * 2 end"))
|
||||
end
|
||||
|
||||
private
|
||||
|
|
Loading…
Add table
Reference in a new issue