Project

General

Profile

Actions

Bug #6211

closed

Ripper lexes :on_rbrace when it should find :on_embexpr_end

Added by turboladen (Steve Loveless) over 12 years ago. Updated over 12 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin11.3.0]
Backport:
[ruby-core:43775]

Description

=begin
1.9.3-p125 :001 > require 'ripper'
=> true
1.9.3-p125 :002 > Ripper.lex %Q{\#{cmd}}
=> [[[1, 0], :on_backtick, ""], [[1, 1], :on_embexpr_beg, "\#{"], [[1, 3], :on_ident, "cmd"], [[1, 6], :on_rbrace, "}"], [[1, 7], :on_tstring_end, ""]]

I'd expect (({[[1, 6], :on_rbrace, "}"]})) to be (({[[1, 6], :on_embexpr_end, "}"]})).

I also just noticed that there's similar behavior with backticks--the first gets parsed as such, but the last gets parsed as (({:on_tstring_end})). This seems less obvious/important (?) compared to the embexpr stuff, as the type of embexpr tokens imply a beg & end; backticks don't imply beg & end, but, all the same, feel inconsistent.
=end

Updated by ko1 (Koichi Sasada) over 12 years ago

  • Category set to ext
  • Assignee set to nobu (Nobuyoshi Nakada)
Actions #2

Updated by nobu (Nobuyoshi Nakada) over 12 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r35269.
Steve, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • parse.y (string_content, parser_yylex): count brace nesting to
    dispatch embexpr_end. [ruby-core:43775][Bug #6211]

Updated by turboladen (Steve Loveless) over 12 years ago

Hooray! Thank you!

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0