summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--parse.y2
-rw-r--r--test/ruby/test_syntax.rb8
2 files changed, 8 insertions, 2 deletions
diff --git a/parse.y b/parse.y
index 3a58d2ee90..58cec8961d 100644
--- a/parse.y
+++ b/parse.y
@@ -2293,7 +2293,7 @@ call_args : command
| assocs opt_block_arg
{
/*%%%*/
- $$ = NEW_LIST($1 ? new_hash($1) : 0);
+ $$ = $1 ? NEW_LIST(new_hash($1)) : 0;
$$ = arg_blk_pass($$, $2);
/*%
$$ = arg_add_assocs(arg_new(), $1);
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb
index 5f0a236619..bd93285ac4 100644
--- a/test/ruby/test_syntax.rb
+++ b/test/ruby/test_syntax.rb
@@ -169,10 +169,16 @@ class TestSyntax < Test::Unit::TestCase
end
def test_keyword_empty_splat
- assert_separately([], <<-'end;')
+ assert_separately([], "#{<<-"begin;"}\n#{<<-'end;'}")
+ begin;
bug10719 = '[ruby-core:67446] [Bug #10719]'
assert_valid_syntax("foo(a: 1, **{})", bug10719)
end;
+ assert_separately([], "#{<<-"begin;"}\n#{<<-'end;'}")
+ begin;
+ bug13756 = '[ruby-core:82113] [Bug #13756]'
+ assert_valid_syntax("defined? foo(**{})", bug13756)
+ end;
end
def test_keyword_self_reference