Project

General

Profile

Actions

Bug #14597

closed

Ripper Issue - introduced between 62674 & 62681

Added by MSP-Greg (Greg L) about 6 years ago. Updated about 6 years ago.

Status:
Closed
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 1 (0 open1 closed)

Related to Ruby master - Feature #4513: allow whitespace following EOL continuation backslashClosednobu (Nobuyoshi Nakada)Actions
Actions #1

Updated by nobu (Nobuyoshi Nakada) about 6 years 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.

Actions #2

Updated by nobu (Nobuyoshi Nakada) about 6 years ago

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

Also available in: Atom PDF

Like0
Like0Like0