Project

General

Profile

Actions

Bug #11812

closed

Lack of space between colon and % literal causes syntax error

Added by fcheung (Frederick Cheung) almost 6 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.3.0preview2 (2015-12-11 trunk 53028) [x86_64-darwin15]
[ruby-core:72084]

Description

The following snippet

{tags:%w(a)}

executes fine in ruby 2.2.3, but raises "syntax error, unexpected '%" when run under ruby 2.3.0preview2. When it is changed to

{tags: %w(a)}

Then it parses with ruby 2.3.0preview2 too.


Related issues

Related to Ruby master - Bug #11833: 2.2.4 syntax error when naked percent notation touches keyword arguments ClosedActions
Has duplicate Ruby master - Bug #11914: 2.2.4: Parsing "symbol:%w(word)" gives SyntaxErrorClosedActions
Has duplicate Ruby master - Bug #12200: MRI 2.2.4 parser forces blanks for hash keys which point to an array literalClosedActions

Updated by yugui (Yuki Sonoda) almost 6 years ago

r51617 is the cause according to bisect.

Actions #2

Updated by yugui (Yuki Sonoda) almost 6 years ago

  • Status changed from Open to Closed

Applied in changeset r53092.


  • parse.y (parse_percent): Allow %-literals in labeled arg as r51624 did for parentheses. Fixes [ruby-core:72084] [Bug #11812].
Actions #3

Updated by yui-knk (Kaneko Yuichiro) almost 6 years ago

  • Related to Bug #11833: 2.2.4 syntax error when naked percent notation touches keyword arguments added

Updated by nagachika (Tomoyuki Chikanaga) almost 6 years ago

  • Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN to 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: REQUIRED

Updated by usa (Usaku NAKAMURA) almost 6 years ago

  • Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: REQUIRED to 2.1: DONTNEED, 2.2: REQUIRED

Updated by nagachika (Tomoyuki Chikanaga) almost 6 years ago

  • Backport changed from 2.1: DONTNEED, 2.2: REQUIRED to 2.1: DONTNEED, 2.2: DONE

Backported into ruby_2_2 branch at r53257.

Actions #7

Updated by nobu (Nobuyoshi Nakada) almost 6 years ago

  • Has duplicate Bug #11914: 2.2.4: Parsing "symbol:%w(word)" gives SyntaxError added
Actions #8

Updated by nobu (Nobuyoshi Nakada) over 5 years ago

  • Has duplicate Bug #12200: MRI 2.2.4 parser forces blanks for hash keys which point to an array literal added
Actions

Also available in: Atom PDF