]> git.lizzy.rs Git - micro.git/blobdiff - runtime/syntax/swift.yaml
Add converted syntax files
[micro.git] / runtime / syntax / swift.yaml
index 2a13a07baaab4ad3c7b462d5daec6bd26cba8bc9..2e63c4fdeb771b84fc0a4e842eedfa2824634933 100644 (file)
@@ -1,49 +1,25 @@
 filetype: swift
 
-detect:
+detect: 
     filename: "\\.swift$"
 
 rules:
-    # Operators
-    - statement: "([.:;,+*|=!?\\%]|<|>|/|-|&)"
-
-      # Statements
-    - statement:  "(class|import|let|var|struct|enum|func|if|else|switch|case|default|for|in|internal|external|unowned|private|public|throws)\\ "
-    - statement:  "(prefix|postfix|operator|extension|lazy|get|set|self|willSet|didSet|override|super|convenience|weak|strong|mutating|return|guard)\\ "
-
-      # Keywords
-    - statement: "(print)"
-    - statement: "(init)"
-
-      # Numbers
+    - symbol.operator: "[.:;,+*|=!?\\%]|<|>|/|-|&"
+    - statement: "(class|import|let|var|struct|enum|func|if|else|switch|case|default|for|in|internal|external|unowned|private|public|throws)\\ "
+    - statement: "(prefix|postfix|operator|extension|lazy|get|set|self|willSet|didSet|override|super|convenience|weak|strong|mutating|return|guard)\\ "
+    - preproc: "(print)"
+    - preproc: "(init)"
     - constant.number: "([0-9]+)"
-
-      # Standard Types
     - type: "\\ ((U)?Int(8|16|32|64))"
-    - constant: "(true|false|nil)"
+    - constant.bool: "(true|false|nil)"
     - type: "\\ (Double|String|Float|Boolean|Dictionary|Array|Int)"
     - type: "\\ (AnyObject)"
-
-    - constant.string:
-        start: "\""
-        end: "\""
-        rules:
-            - constant.specialChar: "\\\\."
-
-    - comment:
-        start: "//"
-        end: "$"
-        rules:
-            - todo: "(TODO|XXX|FIXME):?"
-
-    - comment:
-        start: "///"
-        end: "$"
-        rules:
-            - todo: "(TODO|XXX|FIXME):?"
-
+    - constant.string: "\"[^\"]*\""
+    - comment: "//.*"
+    - comment: "///.*"
     - comment:
         start: "/\\*\\*"
         end: "\\*/"
-        rules:
-            - todo: "(TODO|XXX|FIXME):?"
+        rules: []
+
+    - comment: "[/**]"