Skip to content

Commit 0889bc7

Browse files
authoredNov 4, 2020
Java: Improved package and class name detection (#2599)
1 parent fc60282 commit 0889bc7

11 files changed

+322
-81
lines changed
 

‎components/prism-java.js

+35-17
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,40 @@
22

33
var keywords = /\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/;
44

5+
// full package (optional) + parent classes (optional)
6+
var classNamePrefix = /(^|[^\w.])(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source;
7+
58
// based on the java naming conventions
6-
var className = /\b[A-Z](?:\w*[a-z]\w*)?\b/;
9+
var className = {
10+
pattern: RegExp(classNamePrefix + /[A-Z](?:\w*[a-z]\w*)?\b/.source),
11+
lookbehind: true,
12+
inside: {
13+
'namespace': {
14+
pattern: /^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,
15+
inside: {
16+
'punctuation': /\./
17+
}
18+
},
19+
'punctuation': /\./
20+
}
21+
};
722

823
Prism.languages.java = Prism.languages.extend('clike', {
924
'class-name': [
1025
className,
11-
12-
// variables and parameters
13-
// this to support class names (or generic parameters) which do not contain a lower case letter (also works for methods)
14-
/\b[A-Z]\w*(?=\s+\w+\s*[;,=())])/
26+
{
27+
// variables and parameters
28+
// this to support class names (or generic parameters) which do not contain a lower case letter (also works for methods)
29+
pattern: RegExp(classNamePrefix + /[A-Z]\w*(?=\s+\w+\s*[;,=())])/.source),
30+
lookbehind: true,
31+
inside: className.inside
32+
}
1533
],
1634
'keyword': keywords,
1735
'function': [
1836
Prism.languages.clike.function,
1937
{
20-
pattern: /(\:\:)[a-z_]\w*/,
38+
pattern: /(\:\:\s*)[a-z_]\w*/,
2139
lookbehind: true
2240
}
2341
],
@@ -39,18 +57,9 @@
3957

4058
Prism.languages.insertBefore('java', 'class-name', {
4159
'annotation': {
42-
alias: 'punctuation',
43-
pattern: /(^|[^.])@\w+/,
44-
lookbehind: true
45-
},
46-
'namespace': {
47-
pattern: RegExp(
48-
/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/
49-
.source.replace(/<keyword>/g, function () { return keywords.source; })),
60+
pattern: /(^|[^.])@\w+(?:\s*\.\s*\w+)*/,
5061
lookbehind: true,
51-
inside: {
52-
'punctuation': /\./,
53-
}
62+
alias: 'punctuation'
5463
},
5564
'generics': {
5665
pattern: /<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/,
@@ -60,6 +69,15 @@
6069
'punctuation': /[<>(),.:]/,
6170
'operator': /[?&|]/
6271
}
72+
},
73+
'namespace': {
74+
pattern: RegExp(
75+
/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/
76+
.source.replace(/<keyword>/g, function () { return keywords.source; })),
77+
lookbehind: true,
78+
inside: {
79+
'punctuation': /\./,
80+
}
6381
}
6482
});
6583
}(Prism));

‎components/prism-java.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
@Override
2+
@Documented
3+
@java.long.annotation.Documented
4+
5+
@Retention(value=SOURCE)
6+
@Target(value={PACKAGE,TYPE})
7+
8+
----------------------------------------------------
9+
10+
[
11+
["annotation", "@Override"],
12+
["annotation", "@Documented"],
13+
["annotation", "@java.long.annotation.Documented"],
14+
15+
["annotation", "@Retention"],
16+
["punctuation", "("],
17+
"value",
18+
["operator", "="],
19+
"SOURCE",
20+
["punctuation", ")"],
21+
22+
["annotation", "@Target"],
23+
["punctuation", "("],
24+
"value",
25+
["operator", "="],
26+
["punctuation", "{"],
27+
"PACKAGE",
28+
["punctuation", ","],
29+
"TYPE",
30+
["punctuation", "}"],
31+
["punctuation", ")"]
32+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
class Foo extends foo.bar.Foo {
2+
3+
java.util.List<foo.bar.Foo.Bar> bar(foo.bar.Baz bat) throws java.lang.IOException {
4+
throw new java.lang.UnsupportedOperationException("Not implemented");
5+
}
6+
7+
}
8+
9+
----------------------------------------------------
10+
11+
[
12+
["keyword", "class"],
13+
["class-name", [
14+
"Foo"
15+
]],
16+
["keyword", "extends"],
17+
["class-name", [
18+
["namespace", [
19+
"foo",
20+
["punctuation", "."],
21+
"bar",
22+
["punctuation", "."]
23+
]],
24+
"Foo"
25+
]],
26+
["punctuation", "{"],
27+
28+
["class-name", [
29+
["namespace", [
30+
"java",
31+
["punctuation", "."],
32+
"util",
33+
["punctuation", "."]
34+
]],
35+
"List"
36+
]],
37+
["generics", [
38+
["punctuation", "<"],
39+
["class-name", [
40+
["namespace", [
41+
"foo",
42+
["punctuation", "."],
43+
"bar",
44+
["punctuation", "."]
45+
]],
46+
"Foo",
47+
["punctuation", "."],
48+
"Bar"
49+
]],
50+
["punctuation", ">"]
51+
]],
52+
["function", "bar"],
53+
["punctuation", "("],
54+
["class-name", [
55+
["namespace", [
56+
"foo",
57+
["punctuation", "."],
58+
"bar",
59+
["punctuation", "."]
60+
]],
61+
"Baz"
62+
]],
63+
" bat",
64+
["punctuation", ")"],
65+
["keyword", "throws"],
66+
["class-name", [
67+
["namespace", [
68+
"java",
69+
["punctuation", "."],
70+
"lang",
71+
["punctuation", "."]
72+
]],
73+
"IOException"
74+
]],
75+
["punctuation", "{"],
76+
["keyword", "throw"],
77+
["keyword", "new"],
78+
["class-name", [
79+
["namespace", [
80+
"java",
81+
["punctuation", "."],
82+
"lang",
83+
["punctuation", "."]
84+
]],
85+
"UnsupportedOperationException"
86+
]],
87+
["punctuation", "("],
88+
["string", "\"Not implemented\""],
89+
["punctuation", ")"],
90+
["punctuation", ";"],
91+
["punctuation", "}"],
92+
93+
["punctuation", "}"]
94+
]

‎tests/languages/java/function_featrue.test

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ Bar::foo;
2020
["punctuation", ")"],
2121
["punctuation", ";"],
2222

23-
["class-name", "Bar"],
23+
["class-name", [
24+
"Bar"
25+
]],
2426
["operator", "::"],
2527
["function", "foo"],
2628
["punctuation", ";"]

‎tests/languages/java/generics_feature.test

+47-14
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,90 @@
1-
public class Solo<T> {}
2-
Solo<Integer> val = new Solo<Integer>();
1+
public class Solo<T extends com.foo.Foo.Bar> {}
2+
Solo<Integer> val = new Solo<>();
33
Duo<Double, Character> dual = new Duo<Double, Character>(12.2585, 'C');
44

55
----------------------------------------------------
66

77
[
88
["keyword", "public"],
99
["keyword", "class"],
10-
["class-name", "Solo"],
10+
["class-name", [
11+
"Solo"
12+
]],
1113
["generics", [
1214
["punctuation", "<"],
13-
["class-name", "T"],
15+
["class-name", [
16+
"T"
17+
]],
18+
["keyword", "extends"],
19+
["class-name", [
20+
["namespace", [
21+
"com",
22+
["punctuation", "."],
23+
"foo",
24+
["punctuation", "."]
25+
]],
26+
"Foo",
27+
["punctuation", "."],
28+
"Bar"
29+
]],
1430
["punctuation", ">"]
1531
]],
1632
["punctuation", "{"],
1733
["punctuation", "}"],
1834

19-
["class-name", "Solo"],
35+
["class-name", [
36+
"Solo"
37+
]],
2038
["generics", [
2139
["punctuation", "<"],
22-
["class-name", "Integer"],
40+
["class-name", [
41+
"Integer"
42+
]],
2343
["punctuation", ">"]
2444
]],
2545
" val ",
2646
["operator", "="],
2747
["keyword", "new"],
28-
["class-name", "Solo"],
48+
["class-name", [
49+
"Solo"
50+
]],
2951
["generics", [
3052
["punctuation", "<"],
31-
["class-name", "Integer"],
3253
["punctuation", ">"]
3354
]],
3455
["punctuation", "("],
3556
["punctuation", ")"],
3657
["punctuation", ";"],
3758

38-
["class-name", "Duo"],
59+
["class-name", [
60+
"Duo"
61+
]],
3962
["generics", [
4063
["punctuation", "<"],
41-
["class-name", "Double"],
64+
["class-name", [
65+
"Double"
66+
]],
4267
["punctuation", ","],
43-
["class-name", "Character"],
68+
["class-name", [
69+
"Character"
70+
]],
4471
["punctuation", ">"]
4572
]],
4673
" dual ",
4774
["operator", "="],
4875
["keyword", "new"],
49-
["class-name", "Duo"],
76+
["class-name", [
77+
"Duo"
78+
]],
5079
["generics", [
5180
["punctuation", "<"],
52-
["class-name", "Double"],
81+
["class-name", [
82+
"Double"
83+
]],
5384
["punctuation", ","],
54-
["class-name", "Character"],
85+
["class-name", [
86+
"Character"
87+
]],
5588
["punctuation", ">"]
5689
]],
5790
["punctuation", "("],

‎tests/languages/java/issue1351.test

+18-8
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,33 @@ public class AllChangesIndexer extends SiteIndexer<Change.Id, ChangeData, Change
55
[
66
["keyword", "public"],
77
["keyword", "class"],
8-
["class-name", "AllChangesIndexer"],
8+
["class-name", [
9+
"AllChangesIndexer"
10+
]],
911
["keyword", "extends"],
10-
["class-name", "SiteIndexer"],
12+
["class-name", [
13+
"SiteIndexer"
14+
]],
1115
["generics", [
1216
["punctuation", "<"],
13-
["class-name", "Change"],
14-
["punctuation", "."],
15-
["class-name", "Id"],
17+
["class-name", [
18+
"Change",
19+
["punctuation", "."],
20+
"Id"
21+
]],
1622
["punctuation", ","],
17-
["class-name", "ChangeData"],
23+
["class-name", [
24+
"ChangeData"
25+
]],
1826
["punctuation", ","],
19-
["class-name", "ChangeIndex"],
27+
["class-name", [
28+
"ChangeIndex"
29+
]],
2030
["punctuation", ">"]
2131
]],
2232
["punctuation", "{"]
2333
]
2434

2535
----------------------------------------------------
2636

27-
Checks for generics. See #1351
37+
Checks for generics. See #1351

‎tests/languages/java/module_feature.test

+15-5
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ module com.js.prism {
7878
"net",
7979
["punctuation", "."]
8080
]],
81-
["class-name", "ContentHandlerFactory"],
81+
["class-name", [
82+
"ContentHandlerFactory"
83+
]],
8284
["punctuation", ";"],
8385

8486
["keyword", "opens"],
@@ -88,7 +90,9 @@ module com.js.prism {
8890
"time",
8991
["punctuation", "."]
9092
]],
91-
["class-name", "DateTime"],
93+
["class-name", [
94+
"DateTime"
95+
]],
9296
["punctuation", ";"],
9397

9498
["keyword", "opens"],
@@ -98,7 +102,9 @@ module com.js.prism {
98102
"time",
99103
["punctuation", "."]
100104
]],
101-
["class-name", "LocalDateTime"],
105+
["class-name", [
106+
"LocalDateTime"
107+
]],
102108
["keyword", "to"],
103109
["namespace", [
104110
"java",
@@ -116,7 +122,9 @@ module com.js.prism {
116122
"hello",
117123
["punctuation", "."]
118124
]],
119-
["class-name", "HelloInterface"],
125+
["class-name", [
126+
"HelloInterface"
127+
]],
120128
["keyword", "with"],
121129
["namespace", [
122130
"com",
@@ -126,7 +134,9 @@ module com.js.prism {
126134
"hello",
127135
["punctuation", "."]
128136
]],
129-
["class-name", "HelloModules"],
137+
["class-name", [
138+
"HelloModules"
139+
]],
130140
["punctuation", ";"],
131141

132142
["punctuation", "}"]

‎tests/languages/java/package_feature.test

+20-10
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ import static java.lang.Math.*;
3131
"foo",
3232
["punctuation", "."]
3333
]],
34-
["class-name", "Bar"],
34+
["class-name", [
35+
"Bar"
36+
]],
3537
["punctuation", ";"],
3638
["keyword", "import"],
3739
["namespace", [
@@ -40,9 +42,10 @@ import static java.lang.Math.*;
4042
"lang",
4143
["punctuation", "."]
4244
]],
43-
["class-name", "Math"],
45+
["class-name", [
46+
"Math"
47+
]],
4448
["punctuation", ";"],
45-
4649
["keyword", "import"],
4750
["namespace", [
4851
"java",
@@ -52,17 +55,19 @@ import static java.lang.Math.*;
5255
]],
5356
["operator", "*"],
5457
["punctuation", ";"],
58+
5559
["keyword", "import"],
5660
["keyword", "static"],
5761
["namespace", [
5862
"foo",
5963
["punctuation", "."]
6064
]],
61-
["class-name", "Bar"],
65+
["class-name", [
66+
"Bar"
67+
]],
6268
["punctuation", "."],
6369
"BAZ",
6470
["punctuation", ";"],
65-
6671
["keyword", "import"],
6772
["keyword", "static"],
6873
["namespace", [
@@ -71,11 +76,12 @@ import static java.lang.Math.*;
7176
"lang",
7277
["punctuation", "."]
7378
]],
74-
["class-name", "Math"],
79+
["class-name", [
80+
"Math"
81+
]],
7582
["punctuation", "."],
7683
"PI",
7784
["punctuation", ";"],
78-
7985
["keyword", "import"],
8086
["keyword", "static"],
8187
["namespace", [
@@ -84,7 +90,9 @@ import static java.lang.Math.*;
8490
"lang",
8591
["punctuation", "."]
8692
]],
87-
["class-name", "Math"],
93+
["class-name", [
94+
"Math"
95+
]],
8896
["punctuation", "."],
8997
"sin",
9098
["punctuation", ";"],
@@ -96,12 +104,14 @@ import static java.lang.Math.*;
96104
"lang",
97105
["punctuation", "."]
98106
]],
99-
["class-name", "Math"],
107+
["class-name", [
108+
"Math"
109+
]],
100110
["punctuation", "."],
101111
"*",
102112
["punctuation", ";"]
103113
]
104114

105115
----------------------------------------------------
106116

107-
Checks for packages.
117+
Checks for packages.

‎tests/languages/java/string_feature.test

+4-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ jumps over the lazy dog
1717
String empty = """
1818
""";
1919

20-
2120
----------------------------------------------------
2221

2322
[
@@ -38,7 +37,9 @@ String empty = """
3837
["operator", "+"],
3938
["triple-quoted-string", "\"\"\"\njumps over the lazy dog\n\"\"\""],
4039

41-
["class-name", "String"],
40+
["class-name", [
41+
"String"
42+
]],
4243
" empty ",
4344
["operator", "="],
4445
["triple-quoted-string", "\"\"\"\n\"\"\""],
@@ -47,4 +48,4 @@ String empty = """
4748

4849
----------------------------------------------------
4950

50-
Checks for strings.
51+
Checks for strings.

‎tests/languages/javadoc/code_feature.test

+53-22
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
["code-section", [
7878
["line", [
7979
["code", [
80-
["class-name", "Foo"],
80+
["class-name", ["Foo"]],
8181
["punctuation", "."],
8282
["function", "bar"],
8383
["punctuation", "("],
@@ -93,6 +93,7 @@
9393
]],
9494
["punctuation", ">"]
9595
]],
96+
9697
"\r\n * ",
9798
["tag", [
9899
["tag", [
@@ -104,7 +105,7 @@
104105
["code-section", [
105106
["line", [
106107
["code", [
107-
["class-name", "Foo"]
108+
["class-name", ["Foo"]]
108109
]]
109110
]]
110111
]],
@@ -115,6 +116,7 @@
115116
]],
116117
["punctuation", ">"]
117118
]],
119+
118120
"\r\n *\r\n * ",
119121
["tag", [
120122
["tag", [
@@ -130,6 +132,7 @@
130132
]],
131133
["punctuation", ">"]
132134
]],
135+
133136
["code-section", [
134137
"* ",
135138
["line", [
@@ -153,6 +156,7 @@
153156
["punctuation", "{"]
154157
]]
155158
]],
159+
156160
"\r\n * ",
157161
["line", [
158162
["code", [
@@ -165,12 +169,14 @@
165169
["punctuation", ";"]
166170
]]
167171
]],
172+
168173
"\r\n * ",
169174
["line", [
170175
["code", [
171176
["punctuation", "}"]
172177
]]
173178
]],
179+
174180
"\r\n * ",
175181
["line", [
176182
["code", [
@@ -179,6 +185,7 @@
179185
["punctuation", ";"]
180186
]]
181187
]],
188+
182189
"\r\n *"
183190
]],
184191
["tag", [
@@ -195,6 +202,7 @@
195202
]],
196203
["punctuation", ">"]
197204
]],
205+
198206
"\r\n *\r\n * ",
199207
["tag", [
200208
["tag", [
@@ -205,13 +213,14 @@
205213
]],
206214
["punctuation", "{"],
207215
["keyword", "@code"],
216+
208217
["code-section", [
209218
"* ",
210219
["code", [
211-
["class-name", "String"],
220+
["class-name", ["String"]],
212221
" message ",
213222
["operator", "="],
214-
["class-name", "String"],
223+
["class-name", ["String"]],
215224
["punctuation", "."],
216225
["function", "join"],
217226
["punctuation", "("],
@@ -225,10 +234,12 @@
225234
["punctuation", ")"],
226235
["punctuation", ";"]
227236
]],
237+
228238
"\r\n * ",
229239
["code", [
230240
["comment", "// message returned is: \"Java-is-cool\""]
231241
]],
242+
232243
"\r\n *"
233244
]],
234245
["punctuation", "}"],
@@ -239,6 +250,7 @@
239250
]],
240251
["punctuation", ">"]
241252
]],
253+
242254
"\r\n *\r\n * ",
243255
["tag", [
244256
["tag", [
@@ -247,6 +259,7 @@
247259
]],
248260
["punctuation", ">"]
249261
]],
262+
250263
["code-section", [
251264
"* ",
252265
["line", [
@@ -262,6 +275,7 @@
262275
["number", "1"]
263276
]]
264277
]],
278+
265279
"\r\n *"
266280
]],
267281
["tag", [
@@ -271,6 +285,7 @@
271285
]],
272286
["punctuation", ">"]
273287
]],
288+
274289
"\r\n *\r\n * ",
275290
["tag", [
276291
["tag", [
@@ -279,6 +294,7 @@
279294
]],
280295
["punctuation", ">"]
281296
]],
297+
282298
["code-section", [
283299
"* ",
284300
["line", [
@@ -296,9 +312,7 @@
296312
]],
297313
["punctuation", ">"]
298314
]],
299-
["code", [
300-
"c"
301-
]],
315+
["code", ["c"]],
302316
["tag", [
303317
["tag", [
304318
["punctuation", "</"],
@@ -335,6 +349,7 @@
335349
["punctuation", ")"]
336350
]]
337351
]],
352+
338353
"\r\n * ",
339354
["line", [
340355
["code", [
@@ -355,9 +370,7 @@
355370
]],
356371
["punctuation", ">"]
357372
]],
358-
["code", [
359-
"b"
360-
]],
373+
["code", ["b"]],
361374
["tag", [
362375
["tag", [
363376
["punctuation", "</"],
@@ -381,6 +394,7 @@
381394
["punctuation", ")"]
382395
]]
383396
]],
397+
384398
"\r\n *"
385399
]],
386400
["tag", [
@@ -390,6 +404,7 @@
390404
]],
391405
["punctuation", ">"]
392406
]],
407+
393408
"\r\n *\r\n * ",
394409
["tag", [
395410
["tag", [
@@ -400,53 +415,59 @@
400415
]],
401416
["punctuation", "{"],
402417
["keyword", "@code"],
418+
403419
["code-section", [
404420
"* ",
405421
["code", [
406422
["keyword", "interface"],
407-
["class-name", "ArchiveSearcher"],
423+
["class-name", ["ArchiveSearcher"]],
408424
["punctuation", "{"],
409-
["class-name", "String"],
425+
["class-name", ["String"]],
410426
["function", "search"],
411427
["punctuation", "("],
412-
["class-name", "String"],
428+
["class-name", ["String"]],
413429
" target",
414430
["punctuation", ")"],
415431
["punctuation", ";"],
416432
["punctuation", "}"]
417433
]],
434+
418435
"\r\n * ",
419436
["code", [
420437
["keyword", "class"],
421-
["class-name", "App"],
438+
["class-name", ["App"]],
422439
["punctuation", "{"]
423440
]],
441+
424442
"\r\n * ",
425443
["code", [
426444
["keyword", "void"],
427445
["function", "showSearch"],
428446
["punctuation", "("],
429447
["keyword", "final"],
430-
["class-name", "String"],
448+
["class-name", ["String"]],
431449
" target",
432450
["punctuation", ")"]
433451
]],
452+
434453
"\r\n * ",
435454
["code", [
436455
["keyword", "throws"],
437-
["class-name", "InterruptedException"],
456+
["class-name", ["InterruptedException"]],
438457
["punctuation", "{"]
439458
]],
459+
440460
"\r\n * ",
441461
["code", [
442-
["class-name", "Future"],
462+
["class-name", ["Future"]],
443463
["generics", [
444464
["punctuation", "<"],
445-
["class-name", "String"],
465+
["class-name", ["String"]],
446466
["punctuation", ">"]
447467
]],
448468
" future"
449469
]],
470+
450471
"\r\n * ",
451472
["code", [
452473
["operator", "="],
@@ -455,25 +476,27 @@
455476
["function", "submit"],
456477
["punctuation", "("],
457478
["keyword", "new"],
458-
["class-name", "Callable"],
479+
["class-name", ["Callable"]],
459480
["generics", [
460481
["punctuation", "<"],
461-
["class-name", "String"],
482+
["class-name", ["String"]],
462483
["punctuation", ">"]
463484
]],
464485
["punctuation", "("],
465486
["punctuation", ")"],
466487
["punctuation", "{"]
467488
]],
489+
468490
"\r\n * ",
469491
["code", [
470492
["keyword", "public"],
471-
["class-name", "String"],
493+
["class-name", ["String"]],
472494
["function", "call"],
473495
["punctuation", "("],
474496
["punctuation", ")"],
475497
["punctuation", "{"]
476498
]],
499+
477500
"\r\n * ",
478501
["code", [
479502
["keyword", "return"],
@@ -485,13 +508,15 @@
485508
["punctuation", ")"],
486509
["punctuation", ";"]
487510
]],
511+
488512
"\r\n * ",
489513
["code", [
490514
["punctuation", "}"],
491515
["punctuation", "}"],
492516
["punctuation", ")"],
493517
["punctuation", ";"]
494518
]],
519+
495520
"\r\n * ",
496521
["code", [
497522
["function", "displayOtherThings"],
@@ -500,11 +525,13 @@
500525
["punctuation", ";"],
501526
["comment", "// do other things while searching"]
502527
]],
528+
503529
"\r\n * ",
504530
["code", [
505531
["keyword", "try"],
506532
["punctuation", "{"]
507533
]],
534+
508535
"\r\n * ",
509536
["code", [
510537
["function", "displayText"],
@@ -518,12 +545,13 @@
518545
["punctuation", ";"],
519546
["comment", "// use future"]
520547
]],
548+
521549
"\r\n * ",
522550
["code", [
523551
["punctuation", "}"],
524552
["keyword", "catch"],
525553
["punctuation", "("],
526-
["class-name", "ExecutionException"],
554+
["class-name", ["ExecutionException"]],
527555
" ex",
528556
["punctuation", ")"],
529557
["punctuation", "{"],
@@ -535,10 +563,12 @@
535563
["punctuation", ";"],
536564
["punctuation", "}"]
537565
]],
566+
538567
"\r\n * ",
539568
["code", [
540569
["punctuation", "}"]
541570
]],
571+
542572
"\r\n * ",
543573
["code", [
544574
["punctuation", "}"]
@@ -552,6 +582,7 @@
552582
]],
553583
["punctuation", ">"]
554584
]],
585+
555586
"\r\n */"
556587
]
557588

0 commit comments

Comments
 (0)
Please sign in to comment.