]> git.lizzy.rs Git - micro.git/blob - runtime/syntax/d.yaml
Add converted syntax files
[micro.git] / runtime / syntax / d.yaml
1 filetype: d
2
3 detect: 
4     filename: "\\.(d(i|d)?)$"
5
6 rules:
7     - statement: "(\\*|/|%|\\+|-|>>|<<|>>>|&|\\^(\\^)?|\\||~)?="
8     - statement: "\\.\\.(\\.)?|!|\\*|&|~|\\(|\\)|\\[|\\]|\\\\|/|\\+|-|%|<|>|\\?|:|;"
9     - error: "(0[0-7_]*)(L[uU]?|[uU]L?)?"
10     - constant.number: "([0-9]|[1-9][0-9_]*)(L[uU]?|[uU]L?)?"
11     - constant: "(0[bB][01_]*)(L[uU]?|[uU]L?)?"
12     - constant.number: "[0-9][0-9_]*\\.([0-9][0-9_]*)([eE][+-]?([0-9][0-9_]*))?[fFL]?i?"
13     - constant.number: "[0-9][0-9_]*([eE][+-]?([0-9][0-9_]*))[fFL]?i?"
14     - constant.number: "[^.]\\.([0-9][0-9_]*)([eE][+-]?([0-9][0-9_]*))?[fFL]?i?"
15     - constant.number: "[0-9][0-9_]*([fFL]?i|[fF])"
16     - constant.number: "(0[xX]([0-9a-fA-F][0-9a-fA-F_]*|[0-9a-fA-F_]*[0-9a-fA-F]))(L[uU]?|[uU]L?)?"
17     - constant.number: "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?"
18     - constant.number: "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?"
19     - constant.string: "'([^\\']|\\\\(['\"?\\abfnrtv]|x[[:xdigit:]]{2}|[0-7]{1,3}|u[[:xdigit:]]{4}|U[[:xdigit:]]{8}|&.*;))'"
20     - 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"
21     - statement: "\\b(false|final|finally|for|foreach|foreach_reverse|function|goto|if|immutable|import|in|inout|interface|invariant|is|lazy)\\b"
22     - statement: "\\b(macro|mixin|module|new|nothrow|null|out|override|package|pragma|private|protected|public|pure|ref|return)\\b"
23     - statement: "\\b(scope|shared|static|struct|super|switch|synchronized|template|this|throw|true|try|typeid|typeof|union|unittest|version|while|with)\\b"
24     - statement: "\\b(__FILE__|__MODULE__|__LINE__|__FUNCTION__|__PRETTY_FUNCTION__|__gshared|__traits|__vector|__parameters)\\b"
25     - error: "\\b(delete|deprecated|typedef|volatile)\\b"
26     - 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"
27     - type: "\\b(string|wstring|dstring|size_t|ptrdiff_t)\\b"
28     - constant: "\\b(__DATE__|__EOF__|__TIME__|__TIMESTAMP__|__VENDOR__|__VERSION__)\\b"
29     - constant.string: "\"(\\\\.|[^\"])*\""
30     - constant.string:
31         start: "r\""
32         end: "\""
33         rules: []
34
35     - constant.string: "`[^`]*`"
36     - constant.string: "x\"([[:space:]]*[[:xdigit:]][[:space:]]*[[:xdigit:]])*[[:space:]]*\""
37     - constant.string: "q\"\\(.*\\)\""
38     - constant.string: "q\"\\{.*\\}\""
39     - constant.string: "q\"\\[.*\\]\""
40     - constant.string: "q\"<.*>\""
41     - constant.string:
42         start: "q\"[^({[<\"][^\"]*$"
43         end: "^[^\"]+\""
44         rules: []
45
46     - constant.string: "q\"([^({[<\"]).*\""
47     - comment: "//.*"
48     - comment:
49         start: "/\\*"
50         end: "\\*/"
51         rules: []
52
53     - comment:
54         start: "/\\+"
55         end: "\\+/"
56         rules: []
57