Bug #4242: ruby-mode for emacs syntax highlighting breaks on regular expr=
essions
http://redmine.ruby-lang.org/issues/show/4242

Author: Nguma Abojo
Status: Open, Priority: Low
Category: core, Target version: 1.9.x
ruby -v: ruby 1.9.2p0 (2010-08-18) [i386-mingw32]

I'm not sure what category this one goes to so I apologise if I picked th=
e wrong one.

I believe the syntax highlighting in the ruby-mode for emacs in /misc/rub=
y-mode.rl is broken for certain regular expressions. The RE will then be =
interpreted as non-RE Ruby code and the string quote counting gets all co=
nfused, too. Just fire up the test file I attached in emacs with ruby-mod=
e and it should be fairly obvious.

emacs versions tested:
GNU Emacs 22.3.1 (i386-mingw-nt6.1.7600)
GNU Emacs 23.2.1 (i386-mingw-nt6.1.7600)

ruby-mode versions tested:
Head from svn rep, rev 30480 as I am writing this.


----------------------------------------
http://redmine.ruby-lang.org
IyAtKi0gY29kaW5nOiB1dGYtOCAtKi0NCmRlZiB0ZXN0DQogIHJlcGxhY2Vt
ZW50cyA9DQogICAgWw0KICAgICAjYnJva2VuIGhpZ2hsaWdodGluZyBzdGFy
dHMgaGVyZSAtIFJFcyBhcmUgaW50ZXJwcmV0ZWQgYXMgbm9uLVJFIFJ1Ynkg
Y29kZSBhbmQgdGhlIHN0cmluZyBoaWdobGlnaHRpbmcgYnJlYWtzLCB0b28N
CiAgICAgWy88cD4uKjEuK0NQVUlEIGNsZWFycyB0aGUgaGlnaCAzMiBiaXRz
IG9mLis8XC9wPlxuLywgJyddLA0KICAgICBbJyA8L3A+JywgJzwvcD4nXSwN
CiAgICAgWy88c2VjdD4uKjxcL3NlY3Q+L20sICcnLCAnQ1BVSUQnXSwNCiAg
ICAgWy88cD5OT1RFUzo8XC9wPi4rL20sICcnLCBbIkZBREQvRkFERFAvRklB
REQiLCAiRk1VTC9GTVVMUC9GSU1VTCIsICJGUEFUQU4iXV0sDQogICAgIFsv
PHA+Tk9URVM6PFwvcD4uKz9cbjxcL3A+XG4vbSwgJycsIFsiRkRJVi9GRElW
UC9GSURJViIsICJGREl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