Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

* 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
  • Loading branch information...
commit 9cf2170e78dd1f6f9f7978d05d6947e6025dd61f 1 parent 6f72a6d
@nobu nobu authored
Showing with 11 additions and 1 deletion.
  1. +5 −0 ChangeLog
  2. +1 −1  parse.y
  3. +5 −0 test/ruby/test_syntax.rb
View
5 ChangeLog
@@ -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.
View
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())) {
View
5 test/ruby/test_syntax.rb
@@ -166,6 +166,11 @@ def test_duplicated_when
}
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
Please sign in to comment.
Something went wrong with that request. Please try again.