]> git.lizzy.rs Git - micro.git/blobdiff - runtime/syntax/java.yaml
Merge branch 'python-highlight-zero' of https://github.com/a11ce/micro into a11ce...
[micro.git] / runtime / syntax / java.yaml
index e606de693792d65b002eafe63361cc984a14db13..c045a0c63708e03f1bae9e1e4bb9c757dff65b77 100644 (file)
@@ -1,23 +1,37 @@
 filetype: java
 
-detect: 
+detect:
     filename: "\\.java$"
 
 rules:
     - type: "\\b(boolean|byte|char|double|float|int|long|new|short|this|transient|void)\\b"
     - statement: "\\b(break|case|catch|continue|default|do|else|finally|for|if|return|switch|throw|try|while)\\b"
-    - type.keyword: "\\b(abstract|class|extends|final|implements|import|instanceof|interface|native|package|private|protected|public|static|strictfp|super|synchronized|throws|volatile)\\b"
-    - constant.string: "\"[^\"]*\""
-    - constant.bool: "\\b(true|false|null)\\b"
+    - type: "\\b(abstract|class|extends|final|implements|import|instanceof|interface|native|package|private|protected|public|static|strictfp|super|synchronized|throws|volatile)\\b"
+    - constant: "\\b(true|false|null)\\b"
     - constant.number: "\\b[0-9]+\\b"
-    - comment: "//.*"
+
+    - constant.string:
+        start: "\""
+        end: "\""
+        skip: "\\\\."
+        rules:
+            - constant.specialChar: "\\\\."
+
+    - constant.string:
+        start: "'"
+        end: "'"
+        skip: "\\\\."
+        rules:
+            - preproc: "..+"
+            - constant.specialChar: "\\\\."
+
     - comment:
-        start: "/\\*"
-        end: "\\*/"
+        start: "//"
+        end: "$"
         rules: []
 
     - comment:
-        start: "/\\*\\*"
+        start: "/\\*"
         end: "\\*/"
         rules: []