]> git.lizzy.rs Git - micro.git/blob - runtime/syntax/typescript.yaml
Add template literal string highlighting to typescript (#2525)
[micro.git] / runtime / syntax / typescript.yaml
1 filetype: typescript
2
3 detect:
4     filename: "\\.tsx?$"
5
6 rules:
7     - constant.number: "\\b[-+]?([1-9][0-9]*|0[0-7]*|0x[0-9a-fA-F]+)([uU][lL]?|[lL][uU]?)?\\b"
8     - constant.number: "\\b[-+]?([0-9]+\\.[0-9]*|[0-9]*\\.[0-9]+)([EePp][+-]?[0-9]+)?[fFlL]?"
9     - constant.number: "\\b[-+]?([0-9]+[EePp][+-]?[0-9]+)[fFlL]?"
10     - identifier: "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[(]"
11     - statement: "\\b(abstract|as|async|await|break|case|catch|class|const|constructor|continue)\\b"
12     - statement: "\\b(debugger|declare|default|delete|do|else|enum|export|extends|finally|for|from)\\b"
13     - statement: "\\b(function|get|if|implements|import|in|instanceof|interface|is|let|module|namespace)\\b"
14     - statement: "\\b(new|of|package|private|protected|public|require|return|set|static|super|switch)\\b"
15     - statement: "\\b(this|throw|try|type|typeof|var|void|while|with|yield)\\b"
16     - constant: "\\b(false|true|null|undefined|NaN)\\b"
17     - type: "\\b(Array|Boolean|Date|Enumerator|Error|Function|Math)\\b"
18     - type: "\\b(Number|Object|RegExp|String|Symbol)\\b"
19     - type: "\\b(any|unknown|boolean|never|number|string|symbol)\\b"
20     - statement: "[-+/*=<>!~%?:&|]"
21     - constant: "/[^*]([^/]|(\\\\/))*[^\\\\]/[gim]*"
22     - constant: "\\\\[0-7][0-7]?[0-7]?|\\\\x[0-9a-fA-F]+|\\\\[bfnrt'\"\\?\\\\]"
23     - comment:
24         start: "//"
25         end: "$"
26         rules: []
27     - comment:
28         start: "/\\*"
29         end: "\\*/"
30         rules:
31             - todo: "TODO:?"
32     - constant.string:
33         start: "\""
34         end: "\""
35         skip: "\\\\."
36         rules:
37             - constant.specialChar: "\\\\."
38     - constant.string:
39         start: "'"
40         end: "'"
41         skip: "\\\\."
42         rules:
43             - constant.specialChar: "\\\\."
44     - constant.string:
45         start: "`"
46         end: "`"
47         rules:
48             - constant.specialChar: "\\\\."
49             - identifier: "\\x24\\{.*?\\}"