Bug #14597
closedRipper Issue - introduced between 62674 & 62681
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
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.
Updated by nobu (Nobuyoshi Nakada) about 6 years ago
- Related to Feature #4513: allow whitespace following EOL continuation backslash added