aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMagnus Henoch <[email protected]>2012-08-06 11:16:27 +0100
committerHenrik Nord <[email protected]>2012-08-07 12:09:19 +0200
commit5db6226178d98141b7d1f5cf792797160710c693 (patch)
treeecfe3b830ec953b59503ed633abf0cdce74f0b23 /lib
parent24ad2d1d985bbadb28dc8fe9dfee5e33c3bdcbbc (diff)
downloadotp-5db6226178d98141b7d1f5cf792797160710c693.tar.gz
otp-5db6226178d98141b7d1f5cf792797160710c693.tar.bz2
otp-5db6226178d98141b7d1f5cf792797160710c693.zip
Fix highlighting of atoms ending with a dollar sign
Like this: 'atom$'. In that example, the last single quote should be recognised as ending the atom. This needs a font-lock workaround similar to the one for strings.
Diffstat (limited to 'lib')
-rw-r--r--lib/tools/emacs/erlang.el4
-rw-r--r--lib/tools/emacs/test.erl.indented5
-rw-r--r--lib/tools/emacs/test.erl.orig5
3 files changed, 13 insertions, 1 deletions
diff --git a/lib/tools/emacs/erlang.el b/lib/tools/emacs/erlang.el
index 2f6c7f554e..8f98d6c85c 100644
--- a/lib/tools/emacs/erlang.el
+++ b/lib/tools/emacs/erlang.el
@@ -1516,7 +1516,7 @@ Other commands:
;; A dollar sign right before the double quote that ends a
;; string is not a character escape.
;;
- ;; And a "string" has with a double quote not escaped by a
+ ;; And a "string" consists of a double quote not escaped by a
;; dollar sign, any number of non-backslash non-newline
;; characters or escaped backslashes, a dollar sign
;; (otherwise we wouldn't care) and a double quote. This
@@ -1525,6 +1525,8 @@ Other commands:
;; know whether matching started inside a string: limiting
;; search to a single line keeps things sane.
. (("\\(?:^\\|[^$]\\)\"\\(?:[^\"\n]\\|\\\\\"\\)*\\(\\$\\)\"" 1 "w")
+ ;; Likewise for atoms
+ ("\\(?:^\\|[^$]\\)'\\(?:[^'\n]\\|\\\\'\\)*\\(\\$\\)'" 1 "w")
;; And the dollar sign in $\" escapes two characters, not
;; just one.
("\\(\\$\\)\\\\\\\"" 1 "'"))))))
diff --git a/lib/tools/emacs/test.erl.indented b/lib/tools/emacs/test.erl.indented
index e0593c6522..45d9593000 100644
--- a/lib/tools/emacs/test.erl.indented
+++ b/lib/tools/emacs/test.erl.indented
@@ -215,6 +215,11 @@ highlighting(X) % Function definitions should be highlighted
"char $in string", atom,
+ 'atom$', atom, 'atom$', atom,
+ 'atom\$', atom,
+
+ 'char $in atom', atom,
+
$[, ${, $\\, atom,
?MACRO_1,
?MACRO_2(foo),
diff --git a/lib/tools/emacs/test.erl.orig b/lib/tools/emacs/test.erl.orig
index 69356aca9e..e123150dd1 100644
--- a/lib/tools/emacs/test.erl.orig
+++ b/lib/tools/emacs/test.erl.orig
@@ -215,6 +215,11 @@ highlighting(X) % Function definitions should be highlighted
"char $in string", atom,
+ 'atom$', atom, 'atom$', atom,
+ 'atom\$', atom,
+
+ 'char $in atom', atom,
+
$[, ${, $\\, atom,
?MACRO_1,
?MACRO_2(foo),