]> git.lizzy.rs Git - micro.git/blobdiff - runtime/syntax/python2.yaml
Merge branch 'python-highlight-zero' of https://github.com/a11ce/micro into a11ce...
[micro.git] / runtime / syntax / python2.yaml
index fec4f0c3e01c16d68454a4345ae19cd3c45875e9..f13319377403d0f0e550a731e643c59e8d75a8ea 100644 (file)
@@ -1,8 +1,8 @@
-filetype: python
+filetype: python2
 
 detect:
-    filename: "\\.py$"
-    header: "^#!.*/(env +)?python( |$)"
+    filename: "\\.py2$"
+    header: "^#!.*/(env +)?python2$"
 
 rules:
 
@@ -23,21 +23,33 @@ rules:
       # decorators
     - brightgreen: "@.*[(]"
       # operators
-    - statement: "([.:;,+*|=!\\%@]|<|>|/|-|&)"
+    - symbol.operator: "([.:;,+*|=!\\%@]|<|>|/|-|&)"
       # parentheses
-    - statement: "([(){}]|\\[|\\])"
+    - symbol.brackets: "([(){}]|\\[|\\])"
       # numbers
     - constant.number: "\\b[0-9]+\\b"
 
+    - constant.string:
+        start: "\"\"\""
+        end: "\"\"\""
+        rules: []
+
+    - comment:
+        start: "'''"
+        end: "'''"
+        rules: []
+
     - constant.string:
         start: "\""
-        end: "(?<!\\\\)\""
+        end: "\""
+        skip: "\\\\."
         rules:
             - constant.specialChar: "\\\\."
 
     - constant.string:
         start: "'"
-        end: "(?<!\\\\)'"
+        end: "'"
+        skip: "\\\\."
         rules:
             - constant.specialChar: "\\\\."
 
@@ -46,13 +58,3 @@ rules:
         end: "$"
         rules: []
 
-    - comment:
-        start: "\"\"\""
-        end: "\"\"\""
-        rules: []
-
-    - comment:
-        start: "'''"
-        end: "'''"
-        rules: []
-