Skip to content

Commit

Permalink
- Fixed parsing kwargs in defs with no parens. (presidentbeef)
Browse files Browse the repository at this point in the history
[git-p4: depot-paths = "//src/ruby_parser/dev/": change = 10471]
  • Loading branch information
zenspider committed Dec 23, 2015
1 parent e380619 commit 73a3097
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/ruby_parser.yy
Expand Up @@ -1203,7 +1203,7 @@ rule
{
self.in_single += 1
self.env.extend
lexer.lex_state = :expr_end # force for args
lexer.lex_state = :expr_endfn # force for args
result = lexer.lineno
}
f_arglist bodystmt kEND
Expand Down
4 changes: 1 addition & 3 deletions test/test_ruby_parser.rb
Expand Up @@ -2171,10 +2171,8 @@ def test_multiline_hash_declaration

module TestRubyParserShared20to22
def test_defs_kwarg
skip "not yet"

rb = "def self.a b: 1\nend"
pt = s(:defs, s(:self), :a, s(:args, s(:kwarg, :b, s(:lit, 1))), s(:nil))
pt = s(:defs, s(:self), :a, s(:args, s(:kwarg, :b, s(:lit, 1))))

assert_parse rb, pt
end
Expand Down

0 comments on commit 73a3097

Please sign in to comment.