Project

General

Profile

Bug #14597

Ripper Issue - introduced between 62674 & 62681

Added by MSP-Greg (Greg L) over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.6.0dev (2018-03-07 trunk 62681) [x64-mingw32]
[ruby-core:86080]

Description

The following code generates a Ripper FATAL stop. 62674 is okay, but 62681 errors. Possibly #62675 parse.y: tSPACE for old bison?

require 'ripper'
str = '* The \ must be doubled if not followed by white space: \\.'
tokens = Ripper::Lexer.new(str).lex  # Error here
puts tokens.inspect 

I don't know whether this is considered a bug. YARD uses Ripper for both parsing rb files and also for syntax highlighting of any indented comment block. This is part of a comment block contained in lib/rdoc/markup.rb.

This has parsed without error for quite a long time on my doc site, https://msp-greg.github.io/, which contains Ruby, AWS, Rails, and a few other items. I mention it just because it probably contains quite a few indented comment blocks that are not ruby code.

Or, said another way, I can see how Ripper should not be expected to never error on arbitrary strings passed to it, but it has done so for quite a bit of content for quite a long time...

Sorry for the delay in posting, and thanks, Greg


Related issues

Related to Ruby master - Feature #4513: allow whitespace following EOL continuation backslashClosedActions

Associated revisions

Revision 7773cfa4
Added by nobu (Nobuyoshi Nakada) over 1 year ago

ripper: fix escaped space

  • parse.y: use tSP same as ripper instead of tSPACE.
    [ruby-core:86080] [Bug #14597]

  • ext/ripper/eventids2.c: tSP is defined in ripper.c now.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 62727
Added by nobu (Nobuyoshi Nakada) over 1 year ago

ripper: fix escaped space

  • parse.y: use tSP same as ripper instead of tSPACE.
    [ruby-core:86080] [Bug #14597]

  • ext/ripper/eventids2.c: tSP is defined in ripper.c now.

Revision 62727
Added by nobu (Nobuyoshi Nakada) over 1 year ago

ripper: fix escaped space

  • parse.y: use tSP same as ripper instead of tSPACE.
    [ruby-core:86080] [Bug #14597]

  • ext/ripper/eventids2.c: tSP is defined in ripper.c now.

History

#1

Updated by nobu (Nobuyoshi Nakada) over 1 year ago

  • Status changed from Open to Closed

Applied in changeset trunk|r62727.


ripper: fix escaped space

  • parse.y: use tSP same as ripper instead of tSPACE.
    [ruby-core:86080] [Bug #14597]

  • ext/ripper/eventids2.c: tSP is defined in ripper.c now.

#2

Updated by nobu (Nobuyoshi Nakada) over 1 year ago

  • Related to Feature #4513: allow whitespace following EOL continuation backslash added

Also available in: Atom PDF