]> git.lizzy.rs Git - micro.git/blobdiff - runtime/syntax/d.micro
Update docs and add some comments
[micro.git] / runtime / syntax / d.micro
index c7ccb60330f5a2851ebb315e1ccdfb172288cf92..c52e28f3dc30ba7b4cc0ce8bcfbc63e2c01c05bc 100644 (file)
@@ -3,7 +3,7 @@
 ## Author: Andrei Vinokurov
 ## Based on D lexer specification (http://dlang.org/lex)
 
-syntax "D" "\.(d(i|d)?)$"
+syntax "d" "\.(d(i|d)?)$"
 
 ## Operators and punctuation
 color statement "(\*|/|%|\+|-|>>|<<|>>>|&|\^(\^)?|\||~)?="
@@ -62,30 +62,30 @@ color constant "\b(__DATE__|__EOF__|__TIME__|__TIMESTAMP__|__VENDOR__|__VERSION_
 ## String literals
 ## TODO: multiline backtick and doublequote string. (Unlikely possible at all with nano.)
 ### DoubleQuotedString
-color constant ""(\\.|[^"])*""
+color constant.string ""(\\.|[^"])*""
  
 ### WysiwygString
-color constant (s) "r".*?""
-color constant "`[^`]*`"
+color constant.string start="r"" end="""
+color constant.string "`[^`]*`"
 
 ### HexString
-color ,constant "x"([[:space:]]*[[:xdigit:]][[:space:]]*[[:xdigit:]])*[[:space:]]*""
+color constant.string "x"([[:space:]]*[[:xdigit:]][[:space:]]*[[:xdigit:]])*[[:space:]]*""
 
 ### DelimitedString
-color constant "q"\(.*\)""
-color constant "q"\{.*\}""
-color constant "q"\[.*\]""
-color constant "q"<.*>""
-color constant (s) "q"[^({[<"][^"]*$.*?^[^"]+""
-color constant "q"([^({[<"]).*\1""
+color constant.string "q"\(.*\)""
+color constant.string "q"\{.*\}""
+color constant.string "q"\[.*\]""
+color constant.string "q"<.*>""
+color constant.string start="q"[^({[<"][^"]*$" end="^[^"]+""
+color constant.string "q"([^({[<"]).*""
 
 ### TokenString
 ### True token strings require nesting, so, again, they can't be implemented accurately here.
 ### At the same time, the intended purpose of token strings makes it questionable to highlight them as strings at all.
-## color ,magenta (s) "q\{.*?\}"
+## color ,magenta start="q\{" end="\}"
 
 ## Comments
 ## NB: true nested brightblacks are impossible to implement with plain regex
 color comment "//.*"
-color comment (s) "/\*.*?\*/"
-color comment (s) "/\+.*?\+/"
+color comment start="/\*" end="\*/"
+color comment start="/\+" end="\+/"