]> git.lizzy.rs Git - micro.git/blobdiff - syntax_files/d.micro
Proper window resize handling
[micro.git] / syntax_files / d.micro
index be636a61b1242d71e8e5c050c1b144c363038d66..c7ccb60330f5a2851ebb315e1ccdfb172288cf92 100644 (file)
@@ -6,82 +6,78 @@
 syntax "D" "\.(d(i|d)?)$"
 
 ## Operators and punctuation
-color green "(\*|/|%|\+|-|>>|<<|>>>|&|\^(\^)?|\||~)?="
-color green "\.\.(\.)?|!|\*|&|~|\(|\)|\[|\]|\\|/|\+|-|%|<|>|\?|:|;"
+color statement "(\*|/|%|\+|-|>>|<<|>>>|&|\^(\^)?|\||~)?="
+color statement "\.\.(\.)?|!|\*|&|~|\(|\)|\[|\]|\\|/|\+|-|%|<|>|\?|:|;"
 
 ## Octal integer literals are deprecated
-color ,red "(0[0-7_]*)(L[uU]?|[uU]L?)?"
+color error "(0[0-7_]*)(L[uU]?|[uU]L?)?"
 
 ## Decimal integer literals
-color brightyellow "([0-9]|[1-9][0-9_]*)(L[uU]?|[uU]L?)?"
+color constant "([0-9]|[1-9][0-9_]*)(L[uU]?|[uU]L?)?"
 
 ## Binary integer literals
-color brightgreen "(0[bB][01_]*)(L[uU]?|[uU]L?)?"
+color constant "(0[bB][01_]*)(L[uU]?|[uU]L?)?"
 
 ## Decimal float literals
-color brightblue "[0-9][0-9_]*\.([0-9][0-9_]*)([eE][+-]?([0-9][0-9_]*))?[fFL]?i?"
-color brightblue "[0-9][0-9_]*([eE][+-]?([0-9][0-9_]*))[fFL]?i?"
-color brightblue "[^.]\.([0-9][0-9_]*)([eE][+-]?([0-9][0-9_]*))?[fFL]?i?"
-color brightblue "[0-9][0-9_]*([fFL]?i|[fF])"
+color constant "[0-9][0-9_]*\.([0-9][0-9_]*)([eE][+-]?([0-9][0-9_]*))?[fFL]?i?"
+color constant "[0-9][0-9_]*([eE][+-]?([0-9][0-9_]*))[fFL]?i?"
+color constant "[^.]\.([0-9][0-9_]*)([eE][+-]?([0-9][0-9_]*))?[fFL]?i?"
+color constant "[0-9][0-9_]*([fFL]?i|[fF])"
 
 ## Hexadecimal integer literals
-color brightcyan "(0[xX]([0-9a-fA-F][0-9a-fA-F_]*|[0-9a-fA-F_]*[0-9a-fA-F]))(L[uU]?|[uU]L?)?"
+color constant "(0[xX]([0-9a-fA-F][0-9a-fA-F_]*|[0-9a-fA-F_]*[0-9a-fA-F]))(L[uU]?|[uU]L?)?"
 
 ## Hexadecimal float literals
-color blue "0[xX]([0-9a-fA-F][0-9a-fA-F_]*|[0-9a-fA-F_]*[0-9a-fA-F])(\.[0-9a-fA-F][0-9a-fA-F_]*|[0-9a-fA-F_]*[0-9a-fA-F])?[pP][+-]?([0-9][0-9_]*)[fFL]?i?"
-color blue "0[xX]\.([0-9a-fA-F][0-9a-fA-F_]*|[0-9a-fA-F_]*[0-9a-fA-F])[pP][+-]?([0-9][0-9_]*)[fFL]?i?"
+color constant "0[xX]([0-9a-fA-F][0-9a-fA-F_]*|[0-9a-fA-F_]*[0-9a-fA-F])(\.[0-9a-fA-F][0-9a-fA-F_]*|[0-9a-fA-F_]*[0-9a-fA-F])?[pP][+-]?([0-9][0-9_]*)[fFL]?i?"
+color constant "0[xX]\.([0-9a-fA-F][0-9a-fA-F_]*|[0-9a-fA-F_]*[0-9a-fA-F])[pP][+-]?([0-9][0-9_]*)[fFL]?i?"
 
 
 ## Character literals
-color brightmagenta "'([^\']|\\(['"?\abfnrtv]|x[[:xdigit:]]{2}|[0-7]{1,3}|u[[:xdigit:]]{4}|U[[:xdigit:]]{8}|&.*;))'"
+color constant "'([^\']|\\(['"?\abfnrtv]|x[[:xdigit:]]{2}|[0-7]{1,3}|u[[:xdigit:]]{4}|U[[:xdigit:]]{8}|&.*;))'"
 
 ## Keywords
 ## a-e
-color brightwhite "\b(abstract|alias|align|asm|assert|auto|body|break|case|cast|catch|class|const|continue|debug|default|delegate|do|else|enum|export|extern)\b"
+color statement "\b(abstract|alias|align|asm|assert|auto|body|break|case|cast|catch|class|const|continue|debug|default|delegate|do|else|enum|export|extern)\b"
 ## f-l
-color brightwhite "\b(false|final|finally|for|foreach|foreach_reverse|function|goto|if|immutable|import|in|inout|interface|invariant|is|lazy)\b"
+color statement "\b(false|final|finally|for|foreach|foreach_reverse|function|goto|if|immutable|import|in|inout|interface|invariant|is|lazy)\b"
 ## m-r
-color brightwhite "\b(macro|mixin|module|new|nothrow|null|out|override|package|pragma|private|protected|public|pure|ref|return)\b"
+color statement "\b(macro|mixin|module|new|nothrow|null|out|override|package|pragma|private|protected|public|pure|ref|return)\b"
 ## s-w
-color brightwhite "\b(scope|shared|static|struct|super|switch|synchronized|template|this|throw|true|try|typeid|typeof|union|unittest|version|while|with)\b"
+color statement "\b(scope|shared|static|struct|super|switch|synchronized|template|this|throw|true|try|typeid|typeof|union|unittest|version|while|with)\b"
 ## __
-color brightwhite "\b(__FILE__|__MODULE__|__LINE__|__FUNCTION__|__PRETTY_FUNCTION__|__gshared|__traits|__vector|__parameters)\b"
+color statement "\b(__FILE__|__MODULE__|__LINE__|__FUNCTION__|__PRETTY_FUNCTION__|__gshared|__traits|__vector|__parameters)\b"
 
 ## Deprecated keywords
-color ,red "\b(delete|deprecated|typedef|volatile)\b"
+color error "\b(delete|deprecated|typedef|volatile)\b"
 
 ## Primitive types
-color cyan "\b(bool|byte|cdouble|cent|cfloat|char|creal|dchar|double|float|idouble|ifloat|int|ireal|long|real|short|ubyte|ucent|uint|ulong|ushort|void|wchar)\b"
+color type "\b(bool|byte|cdouble|cent|cfloat|char|creal|dchar|double|float|idouble|ifloat|int|ireal|long|real|short|ubyte|ucent|uint|ulong|ushort|void|wchar)\b"
 
 ## Globally defined symbols
-color cyan "\b(string|wstring|dstring|size_t|ptrdiff_t)\b"
+color type "\b(string|wstring|dstring|size_t|ptrdiff_t)\b"
 
 ## Special tokens
-color ,blue "\b(__DATE__|__EOF__|__TIME__|__TIMESTAMP__|__VENDOR__|__VERSION__)\b"
-
-
-## Special directives, etc.
-color magenta "\\s *#\\s *"
+color constant "\b(__DATE__|__EOF__|__TIME__|__TIMESTAMP__|__VENDOR__|__VERSION__)\b"
 
 ## String literals
 ## TODO: multiline backtick and doublequote string. (Unlikely possible at all with nano.)
 ### DoubleQuotedString
-color yellow ""(\\.|[^"])*""
+color constant ""(\\.|[^"])*""
  
 ### WysiwygString
-color yellow (s) "r".*?""
-color yellow "`[^`]*`"
+color constant (s) "r".*?""
+color constant "`[^`]*`"
 
 ### HexString
-color ,yellow "x"([[:space:]]*[[:xdigit:]][[:space:]]*[[:xdigit:]])*[[:space:]]*""
+color ,constant "x"([[:space:]]*[[:xdigit:]][[:space:]]*[[:xdigit:]])*[[:space:]]*""
 
 ### DelimitedString
-color yellow "q"\(.*\)""
-color yellow "q"\{.*\}""
-color yellow "q"\[.*\]""
-color yellow "q"<.*>""
-color yellow (s) "q"[^({[<"][^"]*$.*?^[^"]+""
-color yellow "q"([^({[<"]).*\1""
+color constant "q"\(.*\)""
+color constant "q"\{.*\}""
+color constant "q"\[.*\]""
+color constant "q"<.*>""
+color constant (s) "q"[^({[<"][^"]*$.*?^[^"]+""
+color constant "q"([^({[<"]).*\1""
 
 ### TokenString
 ### True token strings require nesting, so, again, they can't be implemented accurately here.
@@ -89,11 +85,7 @@ color yellow "q"([^({[<"]).*\1""
 ## color ,magenta (s) "q\{.*?\}"
 
 ## Comments
-## NB: true nested comments are impossible to implement with plain regex
-color brightblack "//.*"
-color brightblack (s) "/\*.*?\*/"
-color brightblack (s) "/\+.*?\+/"
-
-## Trailing whitespace
-color ,green "^[[:space:]]+$"
-
+## NB: true nested brightblacks are impossible to implement with plain regex
+color comment "//.*"
+color comment (s) "/\*.*?\*/"
+color comment (s) "/\+.*?\+/"