From a1bad0e63b8070ecf7b1b7fdc7d74175bb168c86 Mon Sep 17 00:00:00 2001 From: msrocka Date: Fri, 10 Sep 2021 07:53:58 +0200 Subject: updated the Java keyword list taken from https://docs.oracle.com/javase/specs/jls/se16/html/jls-3.html#jls-3.9 (e.g. `then` is not a keyword in Java) I also added the context restricted keywords `var`, `record` etc. to the list; see https://en.wikipedia.org/wiki/List_of_Java_keywords --- plugins/language_java.lua | 106 +++++++++++++++++++++++++--------------------- 1 file changed, 57 insertions(+), 49 deletions(-) (limited to 'plugins') diff --git a/plugins/language_java.lua b/plugins/language_java.lua index 8c6e98e..e6d3735 100644 --- a/plugins/language_java.lua +++ b/plugins/language_java.lua @@ -20,55 +20,63 @@ syntax.add { { pattern = "[%a_][%w_]*", type = "symbol" }, }, symbols = { - ["if"] = "keyword", - ["then"] = "keyword", - ["else"] = "keyword", - ["else if"] = "keyword", - ["do"] = "keyword", - ["while"] = "keyword", - ["for"] = "keyword", - ["new"] = "keyword", - ["break"] = "keyword", - ["continue"] = "keyword", - ["return"] = "keyword", - ["goto"] = "keyword", - ["class"] = "keyword", - ["implements"] = "keyword", - ["extends"] = "keyword", - ["private"] = "keyword", - ["protected"] = "keyword", - ["public"] = "keyword", - ["abstract"] = "keyword", - ["interface"] = "keyword", - ["assert"] = "keyword", - ["import"] = "keyword", - ["native"] = "keyword", - ["package"] = "keyword", - ["super"] = "keyword", - ["synchronized"] = "keyword", - ["instanceof"] = "keyword", - ["enum"] = "keyword", - ["catch"] = "keyword", - ["throw"] = "keyword", - ["throws"] = "keyword", - ["try"] = "keyword", - ["transient"] = "keyword", - ["finally"] = "keyword", - ["static"] = "keyword", - ["volatile"] = "keyword", - ["final"] = "keyword", - ["switch"] = "keyword", - ["case"] = "keyword", - ["default"] = "keyword", - ["void"] = "keyword", - ["int"] = "keyword2", - ["short"] = "keyword2", - ["byte"] = "keyword2", - ["long"] = "keyword2", - ["float"] = "keyword2", - ["double"] = "keyword2", - ["char"] = "keyword2", - ["boolean"] = "keyword2", + ["abstract"] = "keyword", + ["assert"] = "keyword", + ["break"] = "keyword", + ["case"] = "keyword", + ["catch"] = "keyword", + ["class"] = "keyword", + ["const"] = "keyword", + ["continue"] = "keyword", + ["default"] = "keyword", + ["do"] = "keyword", + ["else"] = "keyword", + ["enum"] = "keyword", + ["extends"] = "keyword", + ["final"] = "keyword", + ["finally"] = "keyword", + ["for"] = "keyword", + ["if"] = "keyword", + ["goto"] = "keyword", + ["implements"] = "keyword", + ["import"] = "keyword", + ["instanceof"] = "keyword", + ["interface"] = "keyword", + ["native"] = "keyword", + ["new"] = "keyword", + ["package"] = "keyword", + ["permits"] = "keyword", + ["private"] = "keyword", + ["protected"] = "keyword", + ["public"] = "keyword", + ["record"] = "keyword", + ["return"] = "keyword", + ["sealed"] = "keyword", + ["static"] = "keyword", + ["strictfp"] = "keyword", + ["super"] = "keyword", + ["switch"] = "keyword", + ["synchronized"] = "keyword", + ["this"] = "keyword", + ["throw"] = "keyword", + ["throws"] = "keyword", + ["transient"] = "keyword", + ["try"] = "keyword", + ["var"] = "keyword", + ["void"] = "keyword", + ["volatile"] = "keyword", + ["while"] = "keyword", + ["yield"] = "keyword", + + ["boolean"] = "keyword2", + ["byte"] = "keyword2", + ["char"] = "keyword2", + ["double"] = "keyword2", + ["float"] = "keyword2", + ["int"] = "keyword2", + ["long"] = "keyword2", + ["short"] = "keyword2", + ["true"] = "literal", ["false"] = "literal", ["null"] = "literal", -- cgit v1.2.3