1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* parse.y (parse_percent): Allow %-literals in labeled arg as

r51624 did for parentheses.
  Fixes [ruby-core:72084] [Bug #11812].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
yugui 2015-12-13 11:17:18 +00:00
parent 5f0324e52d
commit 99ac392284
3 changed files with 13 additions and 1 deletions

View file

@ -1,3 +1,9 @@
Sun Dec 13 20:12:14 2015 Yuki Yugui Sonoda <yugui@yugui.jp>
* parse.y (parse_percent): Allow %-literals in labeled arg as
r51624 did for parentheses.
Fixes [ruby-core:72084] [Bug #11812].
Sun Dec 13 20:02:15 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
* ChangeLog: fix a typo

View file

@ -7696,7 +7696,7 @@ parse_percent(struct parser_params *parser, const int space_seen, const enum lex
{
register int c;
if (IS_lex_state(EXPR_BEG_ANY)) {
if (IS_BEG()) {
int term;
int paren;

View file

@ -335,6 +335,12 @@ WARN
assert_valid_syntax("{foo: /=/}", bug11456)
end
def test_percent_string_after_label
bug11812 = ['ruby-core:72084']
assert_valid_syntax('{label:%w(*)}', bug11812)
assert_valid_syntax('{label: %w(*)}', bug11812)
end
def test_duplicated_arg
assert_syntax_error("def foo(a, a) end", /duplicated argument name/)
assert_nothing_raised { def foo(_, _) end }