Repository navigation
Expand file tree
/
Copy path[.Java.Jsp]Java.mtsx
More file actions
129 lines (109 loc) · 4.21 KB
/
Copy path[.Java.Jsp]Java.mtsx
File metadata and controls
129 lines (109 loc) · 4.21 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
// @author:林映雪
//@modified by 2386866276@qq.com or pangfuga@gmail.com
// Licensed under the Apache License, Version 2.0
// https://github.com/2386866276
{
name: ["Java", ".java", ".jsp"],
ignoreCase: false,
styles: [
"funcName" #009999 #66e6ff,
"operator" #00009c #abc9ff,
"member" #0066ad #bce0ff,
"method" #0039e6 #57b3ff,
"annotation" #cc5e00 #ffb373,
"nodeReference" #2e8c00 #63c259,
"comment" #141414 #dddddd,
"docComment" #282666 #99b3cc,
"identifier" #000000 #ffffff,
"string" #996b00 #ffeda1,
"keyword" #e62282 #ff7085,
"contorKeyword" #bd1fcc #ff8ccc,
"number" #008c47 #a1ffe0,
"type" #009933 #42ffc2,
"critical" #cc2424 #c45959,
"warning" #bf6308 #b89c7a,
"notice" #3d8a17 #8fab82,
"placeholder" #ed9954 #ffbf66
],
bracketPairs: ["{}", "[]", "()", "<>"],
contains: [
// 文档注释
{
start: {match: /\/\*\*/},
end: {match: /\*\//},
style: "docComment"
},
// 块注释
{
start: {match: /\/\*/},
end: {match: /\*\//},
style: "comment",
contains: [
{match: /\b(TODO|FIXME|XXX)\b/, 0: "critical"},
{match: /\b(WARNING|HACK)\b/, 0: "warning"},
{match: /\b(NOTE|NOTICE)\b/, 0: "notice"}
]
},
// 行注释
{
start: {match: /\/\//},
end: {match: /(?m)$/},
style: "comment",
contains: [
{match: /\b(TODO|FIXME|XXX)\b/, 0: "critical"},
{match: /\b(WARNING|HACK)\b/, 0: "warning"},
{match: /\b(NOTE|NOTICE)\b/, 0: "notice"}
]
},
// 文本块
{
style: "string",
start: {match: /"""/},
end: {match: /"""/}
},
{builtin: #JAVA_QUOTED_STRING#},
// 数字
{builtin: #JAVA_NUMBER#},
{match: /\b0[xX][0-9a-fA-F_]+[lL]?\b|\b0[bB][01_]+[lL]?\b|\b\d[\d_]*(\.\d[\d_]*)?([eE][+-]?\d[\d_]*)?[fFdDlL]?\b/, 0: "number"},
// 注解
{match: /@\w+(?:\.\w+)*/, 0: "annotation"},
// 包/导入路径
{match: /\b(package|import)\s+([\w.]+)/, 1: "keyword", 2: "nodeReference"},
// 类/接口/枚举名
{match: /\b(class|interface|enum)\s+(\w+)/, 1: "keyword", 2: "type"},
// 常量
{match: /\b[A-Z][A-Z0-9]*(?:_[A-Z0-9]+)+\b(?!\s*\()/, 0: "identifier"},
{match: /\b(?!(?:CRC32|URL|URI|XML|HTML|JSON|HTTP|HTTPS|UUID)\b)[A-Z][A-Z0-9]+\b(?!\.)(?!\s*\()/, 0: "identifier"},
// 控制流关键字
{match: keywordsToRegex("if else switch case default for while do break continue return try catch finally throw"), 0: "contorKeyword"},
// 语言关键字
{
match: keywordsToRegex(
"abstract assert boolean byte char const double extends final float goto implements import instanceof int long native new package private protected public short static strictfp super synchronized this throws transient void volatile"
" var record sealed permits yield"
" true false null"
),
0: "keyword"
},
// 常用类型名
{
match: keywordsToRegex(
"void boolean byte char short int long float double"
" Int Long Float Double Boolean Char Byte Short String Array List Map Set"
" ArrayList HashMap HashSet LinkedList"
" Throwable Exception Error RuntimeException"
),
0: "type"
},
// 方法调用
{match: /\b(\w+)(?=\s*\()/, 1: "method"},
// 成员访问
{match: /\.\s*(\w+)(?=\s*\()/, 1: "method"},
{match: /\.\s*(\w+)/, 1: "member"},
// 运算符
{match: /->|\.\.|::|!=|==|>=|<=|&&|\|\||[+\-*\/\x25&|^~<>!?:]+/, 0: "operator"},
// 默认标识符
{match: /\b[a-zA-Z_$][\w$]*\b/, 0: "identifier"}
],
codeFormatter: #BUILT_IN_JAVA_FORMATTER#
}