-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTypeScript v1.mtsx
More file actions
75 lines (75 loc) · 2.54 KB
/
Copy pathTypeScript v1.mtsx
File metadata and controls
75 lines (75 loc) · 2.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
{
// @tip: 常用词,运算符暂时搁置不做,懒
// @author: binx6
name: ["TypeScript", ".ts", ".tsx"]
colors: [
"pattern", #FFEDED, #443034
"dataType", #4078F2, #0184BB
]
comment: {startsWith: "//"}
comment: {startsWith: "/*", endsWith: "*/"}
lineBackground: {match: /[\t ]*.*use strict.*/, color: "pattern"}
contains: [
{
color: "string"
start: {match: /'/}
end: {match: /(?m)'|$/}
contains: [
{match: /\\\n/, 0: "strEscape"}
{builtin: #JAVA_ESCAPED_CHAR#}
]
}
{
color: "string"
start: {match: /"/}
end: {match: /(?m)"|$/}
contains: [
{match: /\\\n/, 0: "strEscape"}
{builtin: #JAVA_ESCAPED_CHAR#}
]
}
{
color: "string"
start: {match: /`/}
end: {match: /`/}
contains: [
{match: /\\`/, 0: "strEscape"}
{builtin: #JAVA_ESCAPED_CHAR#}
{match: /\$\{.*?\}/, 0: "dataType"}
]
}
// 正则表达式
{
color: "meta"
start: {match: "(=\\s*)/", 1: "default"}
end: {match: "(?m)/([img]*)|$", 1: "operator"}
contains: [
{match: "\\\\/", 0: "strEscape"}
]
}
{builtin: #JAVA_QUOTED_STRING#}
{builtin: #C_QUOTED_STRING#}
{number: "10|16|F|E|P"}
{match: keywordsToRegex(
"as async await constructor declare from get global instanceof is keyof"
"module namespace never readonly require set type unique"
"export default export import static public private protected implements"
"interface extends abstract class function var let const if else for while do switch case"
"break continue throw try catch finally return this super true false typeof of"
"with collapse exists in out new debugger"
), 0: "keyword"}
{match: keywordsToRegex(
"boolean number string void null undefined bigint symbol tuple enum any unknown Array object"
), 0: "meta"}
{match: keywordsToRegex(
"log exit exec error message forEach description pattern required"
), 0: "variable"}
{match: keywordsToRegex(
"console process colors path fork document"
), 0: "constant"}
{match: keywordsToRegex(
"Error"
), 0: "error"}
]
codeFormatter: #BUILT_IN_JS_FORMATTER#
}