Skip to content

Commit 98e57db

Browse files
wasamasajosteink
authored andcommitted
Allow strings as switch-case values
Closes #86
1 parent 60c687a commit 98e57db

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

csharp-mode.el

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1395,6 +1395,14 @@ This regexp is assumed to not match any non-operator identifier."
13951395
(c-lang-const c-cpp-matchers)))
13961396

13971397

1398+
;; allow strings as switch-case values by leaving out string
1399+
;; delimiters in this definition
1400+
(c-lang-defconst c-nonlabel-token-key
1401+
csharp (c-make-keywords-re t
1402+
(cl-set-difference (c-lang-const c-keywords)
1403+
(append (c-lang-const c-label-kwds)
1404+
(c-lang-const c-protection-kwds))
1405+
:test 'string-equal)))
13981406

13991407
(defconst csharp-font-lock-keywords-1 (c-lang-const c-matchers-1 csharp)
14001408
"Minimal highlighting for C# mode.")

0 commit comments

Comments
 (0)