Skip to content

Commit 47910b5

Browse files
author
Nicolai Parlog
authored
Java: Added record keyword (#2185)
This adds support for the new `record` keyword from Java 14.
1 parent f941102 commit 47910b5

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

components/prism-java.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
(function (Prism) {
22

3-
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|null|open|opens|package|private|protected|provides|public|requires|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/;
3+
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|null|open|opens|package|private|protected|provides|public|record|requires|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/;
44

55
// based on the java naming conventions
66
var className = /\b[A-Z](?:\w*[a-z]\w*)?\b/;

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.

tests/languages/java/keyword_feature.test

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ protected throw byte else
99
import public throws case
1010
enum
1111
instanceof
12-
return transient catch
12+
record return transient catch
1313
extends
1414
int short try char
1515
final
@@ -39,7 +39,7 @@ yield
3939
["keyword", "import"], ["keyword", "public"], ["keyword", "throws"], ["keyword", "case"],
4040
["keyword", "enum"],
4141
["keyword", "instanceof"],
42-
["keyword", "return"], ["keyword", "transient"], ["keyword", "catch"],
42+
["keyword", "record"], ["keyword", "return"], ["keyword", "transient"], ["keyword", "catch"],
4343
["keyword", "extends"],
4444
["keyword", "int"], ["keyword", "short"], ["keyword", "try"], ["keyword", "char"],
4545
["keyword", "final"],

0 commit comments

Comments
 (0)