[Bug 1197803] [NEW] Ruby regex syntax sugar not supported

Bjartur Thorlacius svartman95 at gmail.com
Thu Jul 4 13:17:41 UTC 2013


Public bug reported:

The syntax highlighting for Ruby does not highlight regular expressions,
but rather highlights the regular expressions as if it were Ruby code.
Highlighting might help to remind a programmer to close a regex. In
special, a double slash at appended to an expression neither marks the
beginning of a NL delimited comment, nor is it a syntactical error. Ruby
interprets the former slash as a division sign and the latter as marking
the beginning of a multi-line regular expression. Unfortunately, English
sentences are valid regular expressions. The unintended regular
expression thus continues till the next forward slash.

Example erronous code:
puts "Hello, World!" //Classic     <- Meant to be a comment
puts "Ruby considers this line, and most of the next one, to be part of a multi-line regular expression"
puts "A regular expression is not a valid divisor. Ruby performs type checks /after/ parsing"

And the debugging output:
sample:3: unknown regexp options - aftr
sample:3: syntax error, unexpected tSTRING_BEG, expecting keyword_do or '{' or '('
sample:3: unterminated string meets end of file

ProblemType: Bug
DistroRelease: Ubuntu 13.04
Package: vim-nox 2:7.3.547-6ubuntu5
ProcVersionSignature: Ubuntu 3.8.0-25.37-generic 3.8.13
Uname: Linux 3.8.0-25-generic i686
ApportVersion: 2.9.2-0ubuntu8.1
Architecture: i386
Date: Thu Jul  4 12:54:06 2013
EcryptfsInUse: Yes
InstallationDate: Installed on 2013-03-05 (120 days ago)
InstallationMedia: Ubuntu 12.10 "Quantal Quetzal" - Release i386 (20121017.2)
MarkForUpload: True
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: vim
UpgradeStatus: Upgraded to raring on 2013-05-06 (59 days ago)

** Affects: vim (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: apport-bug i386 raring

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to vim in Ubuntu.
https://bugs.launchpad.net/bugs/1197803

Title:
  Ruby regex syntax sugar not supported

Status in “vim” package in Ubuntu:
  New

Bug description:
  The syntax highlighting for Ruby does not highlight regular
  expressions, but rather highlights the regular expressions as if it
  were Ruby code. Highlighting might help to remind a programmer to
  close a regex. In special, a double slash at appended to an expression
  neither marks the beginning of a NL delimited comment, nor is it a
  syntactical error. Ruby interprets the former slash as a division sign
  and the latter as marking the beginning of a multi-line regular
  expression. Unfortunately, English sentences are valid regular
  expressions. The unintended regular expression thus continues till the
  next forward slash.

  Example erronous code:
  puts "Hello, World!" //Classic     <- Meant to be a comment
  puts "Ruby considers this line, and most of the next one, to be part of a multi-line regular expression"
  puts "A regular expression is not a valid divisor. Ruby performs type checks /after/ parsing"

  And the debugging output:
  sample:3: unknown regexp options - aftr
  sample:3: syntax error, unexpected tSTRING_BEG, expecting keyword_do or '{' or '('
  sample:3: unterminated string meets end of file

  ProblemType: Bug
  DistroRelease: Ubuntu 13.04
  Package: vim-nox 2:7.3.547-6ubuntu5
  ProcVersionSignature: Ubuntu 3.8.0-25.37-generic 3.8.13
  Uname: Linux 3.8.0-25-generic i686
  ApportVersion: 2.9.2-0ubuntu8.1
  Architecture: i386
  Date: Thu Jul  4 12:54:06 2013
  EcryptfsInUse: Yes
  InstallationDate: Installed on 2013-03-05 (120 days ago)
  InstallationMedia: Ubuntu 12.10 "Quantal Quetzal" - Release i386 (20121017.2)
  MarkForUpload: True
  ProcEnviron:
   TERM=xterm
   PATH=(custom, no user)
   XDG_RUNTIME_DIR=<set>
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  SourcePackage: vim
  UpgradeStatus: Upgraded to raring on 2013-05-06 (59 days ago)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/vim/+bug/1197803/+subscriptions




More information about the foundations-bugs mailing list