]> git.lizzy.rs Git - micro.git/blobdiff - runtime/syntax/csharp.yaml
groovy highlight (#1866)
[micro.git] / runtime / syntax / csharp.yaml
index 2f69dce1ea2d8ea57ae1b7da51e86e743af1f997..620aada01d3fb2a5948cdcfd4a2ee382b14d2501 100644 (file)
@@ -1,7 +1,7 @@
 filetype: csharp
 
 detect:
-    filename: "\\.cs"
+    filename: "\\.cs$"
 
 rules:
     # Class
@@ -10,7 +10,7 @@ rules:
       # Annotation
     - identifier.var: "@[A-Za-z]+"
 
-    - identifier: "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[()]"
+    - identifier: "([A-Za-z0-9_]*[[:space:]]*[()])"
     - type: "\\b(bool|byte|sbyte|char|decimal|double|float|IntPtr|int|uint|long|ulong|object|short|ushort|string|base|this|var|void)\\b"
     - statement: "\\b(alias|as|case|catch|checked|default|do|dynamic|else|finally|fixed|for|foreach|goto|if|is|lock|new|null|return|switch|throw|try|unchecked|while)\\b"
     - statement: "\\b(abstract|async|class|const|delegate|enum|event|explicit|extern|get|implicit|in|internal|interface|namespace|operator|out|override|params|partial|private|protected|public|readonly|ref|sealed|set|sizeof|stackalloc|static|struct|typeof|unsafe|using|value|virtual|volatile|yield)\\b"
@@ -23,14 +23,16 @@ rules:
 
     - constant.string:
         start: "\""
-        end: "(?<!\\\\)\""
+        end: "\""
+        skip: "\\\\."
         rules:
             - constant.specialChar: "\\\\([btnfr]|'|\\\"|\\\\)"
             - constant.specialChar: "\\\\u[A-Fa-f0-9]{4}"
 
     - constant.string:
         start: "'"
-        end: "(?<!\\\\)'"
+        end: "'"
+        skip: "\\\\."
         rules:
             - constant.specialChar: "\\\\([btnfr]|'|\\\"|\\\\)"
             - constant.specialChar: "\\\\u[A-Fa-f0-9]{4}"