Skip to content

Commit

Permalink
Java: Added Java 15 keywords (#2567)
Browse files Browse the repository at this point in the history
  • Loading branch information
RunDevelopment authored Oct 13, 2020
1 parent 38808e6 commit 73f81c8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 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|record|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|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/;

// 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: 3 additions & 1 deletion tests/languages/java/keyword_feature.test
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ module requires transitive
exports uses open
opens with to provides
yield
sealed non-sealed permits

----------------------------------------------------

Expand Down Expand Up @@ -53,7 +54,8 @@ yield
["keyword", "module"], ["keyword", "requires"], ["keyword", "transitive"],
["keyword", "exports"], ["keyword", "uses"], ["keyword", "open"],
["keyword", "opens"], ["keyword", "with"], ["keyword", "to"], ["keyword", "provides"],
["keyword", "yield"]
["keyword", "yield"],
["keyword", "sealed"], ["keyword", "non-sealed"], ["keyword", "permits"]
]

----------------------------------------------------
Expand Down

0 comments on commit 73f81c8

Please sign in to comment.