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

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

[elpa] externals/csharp-mode fc6f94f 339/459: Handle "nameof" entirely i


From: ELPA Syncer
Subject: [elpa] externals/csharp-mode fc6f94f 339/459: Handle "nameof" entirely in c-basic-matchers-after.
Date: Sun, 22 Aug 2021 13:59:56 -0400 (EDT)

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

    Handle "nameof" entirely in c-basic-matchers-after.
    
    - both "keyword" and variable.
    
    This closes https://github.com/josteink/csharp-mode/issues/190.
---
 csharp-mode.el | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/csharp-mode.el b/csharp-mode.el
index 692db57..62a27fc 100644
--- a/csharp-mode.el
+++ b/csharp-mode.el
@@ -47,7 +47,15 @@
 
   (defconst csharp--regex-type-name-matcher
     (concat "\\(" csharp--regex-type-name "\\)")
-    "Regex matching a type identifier in C#."))
+    "Regex matching a type identifier in C#.")
+
+  (defconst csharp--regex-identifier
+    "[A-Za-z][A-Za-z0-9_]*"
+    "Regex describing an dentifier in C#.")
+
+  (defconst csharp--regex-identifier-matcher
+    (concat "\\(" csharp--regex-identifier "\\)")
+    "Regex matching an identifier in C#."))
 
 (eval-and-compile
   (c-add-language 'csharp-mode 'java-mode))
@@ -155,7 +163,7 @@
 
 (c-lang-defconst c-other-kwds
   csharp '("select" "from" "where" "join" "in" "on" "equals" "into"
-           "orderby" "ascending" "descending" "group" "nameof" "when"
+           "orderby" "ascending" "descending" "group" "when"
            "let" "by"))
 
 (c-lang-defconst c-colon-type-list-kwds
@@ -308,6 +316,12 @@
           `((,(concat "^namespace\\s *" csharp--regex-type-name-matcher" \\s 
*")
              1 font-lock-variable-name-face t))
 
+          `((,(concat "\\(\\<nameof\\>\\) *(" )
+             1 font-lock-function-name-face t))
+
+          `((,(concat "\\<nameof\\> *( *" csharp--regex-identifier-matcher " 
*) *")
+             1 font-lock-variable-name-face t))
+
           ;; function names
           `(("\\([A-Za-z0-9_]+\\)\\(<[a-zA-Z0-9, ]+>\\)?("
              1 font-lock-function-name-face t))



reply via email to

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