emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/csharp-mode 643c63e 268/459: Highlight "value" as a con


From: ELPA Syncer
Subject: [elpa] externals/csharp-mode 643c63e 268/459: Highlight "value" as a constant.
Date: Sun, 22 Aug 2021 13:59:41 -0400 (EDT)

branch: externals/csharp-mode
commit 643c63ee11bf0bbaf37204251edb5f441c269d10
Author: Jostein Kjønigsen <jostein@kjonigsen.net>
Commit: Jostein Kjønigsen <jostein@kjonigsen.net>

    Highlight "value" as a constant.
    
    Test-cases.
    
    This closes https://github.com/josteink/csharp-mode/issues/141.
---
 csharp-mode-tests.el | 11 +++++++++++
 csharp-mode.el       |  2 +-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/csharp-mode-tests.el b/csharp-mode-tests.el
index d166a3f..8440ad0 100644
--- a/csharp-mode-tests.el
+++ b/csharp-mode-tests.el
@@ -54,6 +54,17 @@
                         "true"       'font-lock-constant-face
                         ))
 
+(ert-deftest fontification-of-constants ()
+  (require 'assess)
+  (assess-face-in-text=
+   "testBool1 = true;\ntestBool2 = false;\ntestObj = null;\ntestProp = value;"
+   ;; should not be interpreted as string because of trailing \!
+   "false" 'font-lock-constant-face
+   "true"  'font-lock-constant-face
+   "null"  'font-lock-constant-face
+   "value" 'font-lock-constant-face
+   ))
+
 (ert-deftest fontification-of-literals-allows-multi-line-strings ()
   (require 'assess)
   (should (assess-face-at=
diff --git a/csharp-mode.el b/csharp-mode.el
index e6d411d..111a87f 100644
--- a/csharp-mode.el
+++ b/csharp-mode.el
@@ -1384,7 +1384,7 @@ This regexp is assumed to not match any non-operator 
identifier."
 
 ;; Constant keywords
 (c-lang-defconst c-constant-kwds
-  csharp '("true" "false" "null"))
+  csharp '("true" "false" "null" "value"))
 
 ;; Keywords that start "primary expressions."
 (c-lang-defconst c-primary-expr-kwds



reply via email to

[Prev in Thread] Current Thread [Next in Thread]