]> git.lizzy.rs Git - micro.git/blobdiff - runtime/syntax/cpp.yaml
Highlight NimScript files (.nims) as Nim
[micro.git] / runtime / syntax / cpp.yaml
index 610cd4af4d0eeae6be9cdb93b8d2d3622706adb5..d1ffaeb6f9fc62c549c1d2ee79f54c9ca8ed14a7 100644 (file)
@@ -15,25 +15,28 @@ rules:
     - preproc: "^[[:space:]]*#[[:space:]]*(define|pragma|include|(un|ifn?)def|endif|el(if|se)|if|warning|error)"
     - constant: "('([^'\\\\]|(\\\\[\"'abfnrtv\\\\]))'|'\\\\(([0-3]?[0-7]{1,2}))'|'\\\\x[0-9A-Fa-f]{1,2}')"
 
-      ##
-      ## GCC builtins
+      # GCC builtins
     - statement: "(__attribute__[[:space:]]*\\(\\([^)]*\\)\\)|__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__)"
 
-      #Operator Color
-    - statement: "([.:;,+*|=!\\%]|<|>|/|-|&)" 
+      # Operator Color
+    - symbol.operator: "([.:;,+*|=!\\%]|<|>|/|-|&)" 
+      # Parenthetical Color
+    - symbol.brackets: "[(){}]|\\[|\\]"
 
     - constant.number: "(\\b[0-9]+\\b|\\b0x[0-9A-Fa-f]+\\b)"
-    - constant.number: "(\\b(true|false)\\b|NULL)"
+    - constant.bool: "(\\b(true|false)\\b|NULL)"
 
     - constant.string:
         start: "\""
         end: "\""
+        skip: "\\\\."
         rules:
             - constant.specialChar: "\\\\."
 
     - constant.string:
         start: "'"
         end: "'"
+        skip: "\\\\."
         rules:
             - preproc: "..+"
             - constant.specialChar: "\\\\."
@@ -49,3 +52,4 @@ rules:
         end: "\\*/"
         rules:
             - todo: "(TODO|XXX|FIXME):?"
+