Bug #6488

String#slice example has a syntax error

Added by Benny Lyne Amorsen almost 2 years ago. Updated almost 2 years ago.

[ruby-core:45207]
Status:Closed
Priority:Normal
Assignee:Eric Hodel
Category:doc
Target version:1.9.3
ruby -v:ruby 1.9.3p0 (2011-10-30) [x86_64-linux] Backport:

Description

http://www.ruby-doc.org/core-1.9.3/String.html#method-i-slice has a syntax error:

a[%raeiou\11//] #=> "ell"
a[%raeiou\11//, 0] #=> "ell"
a[%raeiou\11//, 1] #=> "l"
a[%raeiou\11//, 2] #=> nil

Oh, I have just realized that similar problems exist in the other regexp examples on the page, not just for slice.


Related issues

Duplicated by ruby-trunk - Bug #6523: typos/display errors in Regexp.html page Closed 06/01/2012

History

#1 Updated by Shyouhei Urabe almost 2 years ago

  • Category set to doc
  • Status changed from Open to Assigned
  • Assignee set to Eric Hodel

Seems this is a renderer issue. Eric, what do you think?

#2 Updated by Zachary Scott almost 2 years ago

I was unable to reproduce this with ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-linux] and rdoc 3.9.4

Could be an issue with ruby-doc.org?

#3 Updated by Eric Hodel almost 2 years ago

This is a bug in RDoc's ruby parser

#4 Updated by Eric Hodel almost 2 years ago

  • Status changed from Assigned to Closed

Fixed by eaf2b80c and 0d72fc0d to the rdoc repository.

#5 Updated by Nathan Stratton Treadway almost 2 years ago

The references to the RDoc github commits don't show up as live links, so to save others the trouble of finding them, here are URLs for each:
https://github.com/rdoc/rdoc/commit/eaf2b80c

https://github.com/rdoc/rdoc/commit/0d72fc0d

#6 Updated by Nathan Stratton Treadway almost 2 years ago

=begin
zzak (Zachary Scott) wrote:

I was unable to reproduce this with ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-linux] and rdoc 3.9.4

Could be an issue with ruby-doc.org?

More specifically, it was a problem in the HTML pages generated by RDoc v3.12 (and ruby-doc.org was indeed using that version).

Over the weekend James Britt regenerated the "core" and "std=lib" RDoc pages (for all Ruby versions) using a copy of rdoc that included this bug's ruby_lex.rb patches, so the regexp literals on those pages should be fixed now.

(The gem RDocs on the site are built separately and so they may not have been updated yet.)
=end

Also available in: Atom PDF