From: allen.fair@... Date: 2015-12-28T22:08:12+00:00 Subject: [ruby-core:72572] [Ruby trunk - Bug #11914] [Open] 2.2.4: Parsing "symbol:%w(word)" gives SyntaxError Issue #11914 has been reported by Allen Fair. ---------------------------------------- Bug #11914: 2.2.4: Parsing "symbol:%w(word)" gives SyntaxError https://bugs.ruby-lang.org/issues/11914 * Author: Allen Fair * Status: Open * Priority: Normal * Assignee: * ruby -v: ruby 2.2.4p230 (2015-12-16 revision 53155) [x86_64-darwin14] * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN ---------------------------------------- This snippet does not parse correctly, only in ruby 2.2.4: {a:%w(a)} Adding a space after the "a:" works. irb(main):001:0> RUBY_VERSION => "2.2.4" irb(main):002:0> {a:%w(a)} SyntaxError: (irb):2: syntax error, unexpected '%' {a:%w(a)} ^ (irb):2: syntax error, unexpected '}', expecting end-of-input from /Users/allen/.rbenv/versions/2.2.4/bin/irb:11:in `
' irb(main):003:0> {a: %w(a)} => {:a=>["a"]} This works (without the space) in 2.2.3 and 2.3.0 Work-around: add the space after the colon. My search failed to find an existing issue, but hope this isn't a repeat. Thanks! -- https://bugs.ruby-lang.org/ Unsubscribe: