]> git.lizzy.rs Git - micro.git/blobdiff - runtime/syntax/toml.yaml
Merge pull request #1315 from matbesancon/patch-1
[micro.git] / runtime / syntax / toml.yaml
index c1c8833ff5f2118b9138746f0eef512b92994e27..dcbc1254ecf2ad85f56667824b4c327a3662917a 100644 (file)
@@ -1,18 +1,42 @@
 filetype: toml
 
-detect: 
-    filename: "\\.toml$"
+detect:
+    filename: "\\.toml"
 
 rules:
     - statement: "(.*)[[:space:]]="
     - special: "="
-    - symbol.brackets: "(\\[|\\])"
+
+      # Bracket thingies
+    - special: "(\\[|\\])"
+
+      # Numbers and strings
     - constant.number: "\\b([0-9]+|0x[0-9a-fA-F]*)\\b|'.'"
-    - constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'"
-    - constant.specialChar: "\\\\[abfnrtv'\\\"\\\\]"
-    - constant.specialChar: "\\\\([0-7]{3}|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})"
-    - constant.string: "`[^`]*`"
-    - constant.specialChar: "\""
-    - constant.specialChar: "'"
-    - comment: "(^|[[:space:]])#.*"
-    - todo: "(TODO|XXX|FIXME):?"
+    - constant.number: "\\\\([0-7]{3}|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})"
+
+    - constant.string:
+        start: "\""
+        end: "\""
+        skip: "\\\\."
+        rules:
+            - constant.specialChar: "\\\\."
+
+    - constant.string:
+        start: "'"
+        end: "'"
+        skip: "\\\\."
+        rules:
+            - constant.specialChar: "\\\\."
+
+    - constant.string:
+        start: "`"
+        end: "`"
+        rules:
+            - constant.specialChar: "\\\\."
+
+    - comment:
+        start: "#"
+        end: "$"
+        rules:
+            - todo: "(TODO|XXX|FIXME):?"
+