https://bugs.ruby-lang.org/
https://bugs.ruby-lang.org/favicon.ico?1711330511
2010-09-01T23:15:40Z
Ruby Issue Tracking System
Ruby master - Bug #3765: Ripper::Lexer missed out tokens after '=>' operator
https://bugs.ruby-lang.org/issues/3765?journal_id=13122
2010-09-01T23:15:40Z
eitoball (Eito Katagiri)
eitoball@gmail.com
<ul></ul><p>=begin<br>
I think that it is because the provided statement was illegal and Ripper stopped parsing it.</p>
<p>% ruby -ve ":x => 1"<br>
ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-darwin9.8.0]<br>
-e:1: syntax error, unexpected tASSOC, expecting $end<br>
:x => 1<br>
^</p>
<p>=end</p>
Ruby master - Bug #3765: Ripper::Lexer missed out tokens after '=>' operator
https://bugs.ruby-lang.org/issues/3765?journal_id=13123
2010-09-02T00:07:45Z
mame (Yusuke Endoh)
mame@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Rejected</i></li></ul><p>=begin<br>
Eito is right.</p>
<p>Ruby lexer has very complex states.<br>
Such an incomplete code fragment may not parse.<br>
You should write complete code:</p>
<p>$ ruby -rripper -e 'p *Ripper.lex("foo :x => 1")'<br>
[[1, 0], :on_ident, "foo"]<br>
[[1, 3], :on_sp, " "]<br>
[[1, 4], :on_symbeg, ":"]<br>
[[1, 5], :on_ident, "x"]<br>
[[1, 6], :on_sp, " "]<br>
[[1, 7], :on_op, "=>"]<br>
[[1, 9], :on_sp, " "]<br>
[[1, 10], :on_int, "1"]</p>
<p>--<br>
Yusuke Endoh <a href="mailto:mame@tsg.ne.jp" class="email">mame@tsg.ne.jp</a><br>
=end</p>