seattlerb/ruby_parser — Issue #33: Regression in Ruby 1.8 parsing symbol arguments with poor spacing
Author: presidentbeef
Created: 2012-02-28 18:33:03+00:00
State: open

In Ruby 1.8 this is okay:

```
$ ruby -v
ruby 1.8.7 (2012-02-08 MBARI 8/0x6770 on patchlevel 358) [i686-darwin11.3.0], MBARI 0x6770, Ruby Enterprise Edition 2012.02
$ ruby -c -e "x if blah:y"
```

With ruby_parser 2.3.1 this is okay:

```
$ irb
1.9.3p125 :001 > require 'ruby_parser'
=> true
1.9.3p125 :002 > RubyParser.new.parse "x if blah:y"
=> s(:if, s(:call, nil, :blah, s(:arglist, s(:lit, :y))), s(:call, nil, :x, s(:arglist)), nil)
```

But with the master version of ruby_parser it's not okay:

```
$ irb
1.9.3p125 :001 > require 'ruby_parser'
=> true
1.9.3p125 :002 > Ruby18Parser.new.parse "x if blah:y"
Racc::ParseError:
parse error on value ["blah", 1] (error)
from /Users/collins/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/racc/parser.rb:351:in `on_error'
from (eval):3:in `_racc_do_parse_c'
from (eval):3:in `do_parse'
from /Users/collins/.rvm/gems/ruby-1.9.3-p125@ruby_parser/gems/ruby_parser-3.0.0a1/lib/ruby_parser_extras.rb:779:in `process'
from (irb):2
from /Users/collins/.rvm/rubies/ruby-1.9.3-p125/bin/irb:16:in `

'
```

I know this is terrible, but hopefully since this syntax was already supported before it isn't too hard to make sure it continues to be?