зеркало из https://github.com/github/ruby.git
* parse.y (parser_yylex): allow spaces between lambda arrow and
parenthesis. [ruby-dev:45605][Feature #6390] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
6f72a6dcb5
Коммит
9cf2170e78
|
@ -1,3 +1,8 @@
|
|||
Wed May 2 23:21:20 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* parse.y (parser_yylex): allow spaces between lambda arrow and
|
||||
parenthesis. [ruby-dev:45605][Feature #6390]
|
||||
|
||||
Wed May 2 19:06:30 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
|
||||
|
||||
* cont.c (rb_fiber_m_transfer): Improved Fiber documentation.
|
||||
|
|
2
parse.y
2
parse.y
|
@ -7294,7 +7294,7 @@ parser_yylex(struct parser_params *parser)
|
|||
return tOP_ASGN;
|
||||
}
|
||||
if (c == '>') {
|
||||
lex_state = EXPR_ARG;
|
||||
lex_state = EXPR_ENDFN;
|
||||
return tLAMBDA;
|
||||
}
|
||||
if (IS_BEG() || (IS_SPCARG(c) && arg_ambiguous())) {
|
||||
|
|
|
@ -166,6 +166,11 @@ class TestSyntax < Test::Unit::TestCase
|
|||
}
|
||||
end
|
||||
|
||||
def test_lambda_with_space
|
||||
feature6390 = '[ruby-dev:45605]'
|
||||
assert_valid_syntax("-> (x, y) {}", __FILE__, feature6390)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def not_label(x) @result = x; @not_label ||= nil end
|
||||
|
|
Загрузка…
Ссылка в новой задаче