[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 460e92b 15/27: Add comments with the cases handled
From: |
Dmitry Gutov |
Subject: |
[elpa] master 460e92b 15/27: Add comments with the cases handled |
Date: |
Sat, 29 Oct 2016 00:04:18 +0000 (UTC) |
branch: master
commit 460e92bf4a592bf21afd0b48bbceda6d9d2055b3
Author: Pavel Matcula <address@hidden>
Commit: Pavel Matcula <address@hidden>
Add comments with the cases handled
---
highlight-escape-sequences.el | 48 ++++++++++++++++++++++++++++++++---------
1 file changed, 38 insertions(+), 10 deletions(-)
diff --git a/highlight-escape-sequences.el b/highlight-escape-sequences.el
index 52b53b0..98cf84c 100644
--- a/highlight-escape-sequences.el
+++ b/highlight-escape-sequences.el
@@ -30,7 +30,7 @@
;; `font-lock-regexp-grouping-backslash' face by default.
;; It currently supports `ruby-mode' and some simple modes:
-;; both main JavaScript modes, Java mode, and C/C++ modes.
+;; both main JavaScript modes, Java mode, and C/C++/ObjC modes.
;; To enable it elsewhere, customize `hes-mode-alist'.
@@ -61,10 +61,13 @@
(any "\"\'\\bfnrtv"))))))
"Regexp to match the most common escape sequences.
-Handles octals (\\0-\\777), hexadecimals (\\x00-\\xFF), unicodes
-\(\\u0000-\\uFFFF), and backslash followed by one of `bfnrtv'.")
+Currently handles:
+- octals (\\0 to \\777),
+- hexadecimals (\\x00 to \\xFF),
+- unicodes (\\u0000 to \\uFFFF),
+- and backslash followed by one of \"\'\\bfnrtv.")
-(defconst hes-c/c++-escape-sequence-re
+(defconst hes-c/c++/objc-escape-sequence-re
(rx (submatch
(and ?\\ (submatch
(or (repeat 1 3 (in "0-7"))
@@ -72,7 +75,13 @@ Handles octals (\\0-\\777), hexadecimals (\\x00-\\xFF),
unicodes
(and ?u (repeat 4 xdigit))
(and ?U (repeat 8 xdigit))
(any "\"\'\?\\abfnrtv"))))))
- "Regexp to match C/C++ escape sequences.")
+ "Regexp to match C/C++/ObjC escape sequences.
+
+Currently handles:
+- octals (\\0 to \\777),
+- hexadecimals (\\x0 to \\xF..),
+- unicodes (\\u0000 to \\uFFFF, \\U00000000 to \\UFFFFFFFF),
+- and backslash followed by one of \"\'\?\\abfnrtv.")
(defconst hes-java-escape-sequence-re
(rx (submatch
@@ -80,7 +89,12 @@ Handles octals (\\0-\\777), hexadecimals (\\x00-\\xFF),
unicodes
(or (repeat 1 3 (in "0-7"))
(and ?u (repeat 4 xdigit))
(any "\"\'\\bfnrt"))))))
- "Regexp to match Java escape sequences.")
+ "Regexp to match Java escape sequences.
+
+Currently handles:
+- octals (\\0 to \\777),
+- unicodes (\\u0000 to \\uFFFF),
+- and backslash followed by one of \"\'\\bfnrt.")
(defconst hes-js-escape-sequence-re
(rx (submatch
@@ -90,7 +104,13 @@ Handles octals (\\0-\\777), hexadecimals (\\x00-\\xFF),
unicodes
(and ?u (repeat 4 xdigit))
;; (any "\"\'\\bfnrtv")
any))))) ;; deprecated
- "Regexp to match JavaScript escape sequences.")
+ "Regexp to match JavaScript escape sequences.
+
+Currently handles:
+- octals (\\0 to \\777),
+- hexadecimals (\\x00 to \\xFF),
+- unicodes (\\u0000 to \\uFFFF),
+- and backslash followed by anything else.")
(defconst hes-ruby-escape-sequence-re
(rx (submatch
@@ -107,7 +127,14 @@ Handles octals (\\0-\\777), hexadecimals (\\x00-\\xFF),
unicodes
any)))))
"Regexp to match Ruby escape sequences.
-Currently doesn't handle \\C-, \\M- etc.")
+Currently handles:
+- octals (\\0 to \\777),
+- hexadecimals (\\x0 to \\xFF),
+- unicodes (\\u0000 to \\uFFFF),
+- unicodes in the \\u{} form,
+- and backslash followed by anything else.
+
+Currently doesn't handle \\C-, \\M-, etc.")
(defconst hes-ruby-escape-sequence-keywords
`((,hes-ruby-escape-sequence-re
@@ -143,8 +170,9 @@ Currently doesn't handle \\C-, \\M- etc.")
"Modes where escape sequences can appear in any string literal.")
(defcustom hes-mode-alist
- `((c-mode . ,hes-c/c++-escape-sequence-re)
- (c++-mode . ,hes-c/c++-escape-sequence-re)
+ `((c-mode . ,hes-c/c++/objc-escape-sequence-re)
+ (c++-mode . ,hes-c/c++/objc-escape-sequence-re)
+ (objc-mode . ,hes-c/c++/objc-escape-sequence-re)
(java-mode . ,hes-java-escape-sequence-re)
(js-mode . ,hes-js-escape-sequence-re)
(js2-mode . ,hes-js-escape-sequence-re)
- [elpa] master 9c80a93 18/27: Merge pull request #1 from dev-plvlml/master, (continued)
- [elpa] master 9c80a93 18/27: Merge pull request #1 from dev-plvlml/master, Dmitry Gutov, 2016/10/28
- [elpa] master 72c3cdc 07/27: Change wording, Dmitry Gutov, 2016/10/28
- [elpa] master 1e79174 11/27: Fix extra indent, Dmitry Gutov, 2016/10/28
- [elpa] master fa6dd96 24/27: Delete the obsolete alias, Dmitry Gutov, 2016/10/28
- [elpa] master ffb8c5d 21/27: Merge pull request #3 from plexus/add-elisp-clojure, Dmitry Gutov, 2016/10/28
- [elpa] master 0e74c8c 27/27: Add hes to externals-list, Dmitry Gutov, 2016/10/28
- [elpa] master fc206ba 17/27: Untabify indents, Dmitry Gutov, 2016/10/28
- [elpa] master c3f28f2 25/27: Shorten some lines, Dmitry Gutov, 2016/10/28
- [elpa] master 9b2c607 26/27: Add 'packages/highlight-escape-sequences/' from commit 'c3f28f2003638e88e5cf0b03835412af7814f3b0', Dmitry Gutov, 2016/10/28
- [elpa] master 738f1e3 09/27: Add distinct regexps, Dmitry Gutov, 2016/10/28
- [elpa] master 460e92b 15/27: Add comments with the cases handled,
Dmitry Gutov <=
- [elpa] master e86a466 23/27: Improve commentary, Dmitry Gutov, 2016/10/28
- [elpa] master aaabd19 14/27: Switch to rx macro, Dmitry Gutov, 2016/10/28