branch: elpa/dart-mode
commit e94acb5e37908b9f063e4a8648ae5f69e86b0eec
Author: Brady Trainor <[email protected]>
Commit: Brady Trainor <[email protected]>
Fontify SCREAMING_CAPS words of length greater than two as constant
---
dart-mode.el | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/dart-mode.el b/dart-mode.el
index 429beee..b209d04 100644
--- a/dart-mode.el
+++ b/dart-mode.el
@@ -439,6 +439,11 @@ indentation levels from right to left."
(defvar dart--types-re (rx (eval (dart--identifier 'upper))))
+(defvar dart--constants-re (rx (and word-start
+ upper
+ (>= 2 (or upper ?_))
+ word-end)))
+
(defun dart--string-interpolation-id-func (limit)
"Font-lock matcher for string interpolation identifiers.
@@ -682,6 +687,7 @@ fontify as declared variables. From ECMA-408,
(,dart--hex-number-re . (1 font-lock-constant-face))
(,dart--number-re . (1 font-lock-constant-face))
(,dart--metadata-re . font-lock-constant-face)
+ (,dart--constants-re . font-lock-constant-face)
(,(regexp-opt dart--types 'words) . font-lock-type-face)
(,dart--types-re . font-lock-type-face)
(dart--function-declaration-func . font-lock-function-name-face)))