Skip to content

Commit

Permalink
Update kotlin keywords (thanks to @TorayLife)
Browse files Browse the repository at this point in the history
  • Loading branch information
mchorse committed Dec 8, 2022
1 parent c759097 commit 43c7eca
Showing 1 changed file with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,18 +106,25 @@ public static void initiate()
if (!kts.isFile())
{
SyntaxHighlighter ktsHighlighter = new SyntaxHighlighter();
ktsHighlighter.operators = ImmutableSet.of("+", "-", "=", "/", "*", "<", ">", "~", "&", "|", "!");
ktsHighlighter.operators = ImmutableSet.of("+", "-", "=", "/", "*", "<", ">", "~", "&", "|", "!", "..", "->");
ktsHighlighter.primaryKeywords = ImmutableSet.of(
"break", "continue", "switch", "case", "default", "try",
"break", "continue", "switch", "case", "try",
"catch", "delete", "do", "while", "else", "finally", "if",
"else", "for", "each", "in", "instanceof",
"new", "throw", "typeof", "with", "yield", "return"
"else", "for", "is", "as", "in", "instanceof",
"new", "throw", "typeof", "with", "yield", "when", "return",
"by", "constructor", "delegate", "dynamic", "field", "get", "set", "init", "value",
"where", "actual", "annotation", "companion", "field", "external", "infix", "inline", "inner", "internal",
"open", "operator", "out", "override", "suspend", "vararg"
);
ktsHighlighter.secondaryKeywords = ImmutableSet.of("const", "function", "var", "let", "prototype", "Math", "JSON", "mappet");
ktsHighlighter.special = ImmutableSet.of("this", "arguments");
ktsHighlighter.typeKeywords = ImmutableSet.of("true", "false", "null", "undefined");
ktsHighlighter.secondaryKeywords = ImmutableSet.of(
"abstract", "extends", "final", "implements", "interface", "super", "throws",
"data", "class", "fun", "var", "val", "import", "Java", "JSON", "mappet"
);
ktsHighlighter.special = ImmutableSet.of("this", "it");
ktsHighlighter.typeKeywords = ImmutableSet.of("true", "false", "null", "undefined", "enum");
ktsHighlighter.functionName = Pattern.compile("[\\w_][\\d\\w_]*", Pattern.CASE_INSENSITIVE);


writeHighlighter(kts, ktsHighlighter);
}
}
Expand Down

0 comments on commit 43c7eca

Please sign in to comment.