Project

General

Profile

Actions

Bug #3320

closed

Feature #5142: Remove ruby-mode.el from ruby's repo

emacs ruby-mode.el font-lock fails on symboled string ending with ?

Added by zev (Zev Blut) almost 14 years ago. Updated over 11 years ago.

Status:
Third Party's Issue
Target version:
ruby -v:
1.9.2 (trunk and 1.8.7)+
Backport:
[ruby-core:30315]

Description

=begin
Fontification breaks when emacs sees a symbol like
:'this is a symbol?'

example code:

class EmacsExample
:symbol

'this is a test'
'is this a test?'
"Can this be a test"
:'this is an error?'

def bar
@help
end
end


I have a very hacked fix in ruby-font-lock-syntactic-keywords
for
;; the last $', $", $ in the respective string is not variable ;; the last ?', ?", ? in the respective string is not ascii code
("\(^\|[[ \t\n<+(,=:]\)\(['"]\\)\\(\\\\.\\|\\2\\|[^'\"\n\\]\)*?\\?[?$]\(\2\)"
(2 (7 . nil))
(4 (7 . nil)))

by adding : in the above matches with space tabs L etc...

See the attached patch

I am not sure this is the proper fix, but it fixes the above example.

Thanks,
Zev
=end


Files

ruby-mode.el.patch (1.63 KB) ruby-mode.el.patch zev (Zev Blut), 05/20/2010 12:21 AM

Related issues 2 (0 open2 closed)

Related to Ruby master - Feature #6823: Where/how should ruby-mode issues be reported?Closedmatz (Yukihiro Matsumoto)Actions
Has duplicate Ruby master - Bug #4398: Highlighting of "'?" in EmacsThird Party's Issuenobu (Nobuyoshi Nakada)02/15/2011Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0