Skip to content

Commit

Permalink
Java: Added record keyword (#2185)
Browse files Browse the repository at this point in the history
This adds support for the new `record` keyword from Java 14.
  • Loading branch information
Nicolai Parlog authored Feb 18, 2020
1 parent f941102 commit 47910b5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion components/prism-java.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(function (Prism) {

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/;
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/;

// based on the java naming conventions
var className = /\b[A-Z](?:\w*[a-z]\w*)?\b/;
Expand Down
2 changes: 1 addition & 1 deletion components/prism-java.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions tests/languages/java/keyword_feature.test
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ protected throw byte else
import public throws case
enum
instanceof
return transient catch
record return transient catch
extends
int short try char
final
Expand Down Expand Up @@ -39,7 +39,7 @@ yield
["keyword", "import"], ["keyword", "public"], ["keyword", "throws"], ["keyword", "case"],
["keyword", "enum"],
["keyword", "instanceof"],
["keyword", "return"], ["keyword", "transient"], ["keyword", "catch"],
["keyword", "record"], ["keyword", "return"], ["keyword", "transient"], ["keyword", "catch"],
["keyword", "extends"],
["keyword", "int"], ["keyword", "short"], ["keyword", "try"], ["keyword", "char"],
["keyword", "final"],
Expand Down

0 comments on commit 47910b5

Please sign in to comment.