Skip to content

Commit

Permalink
commit
Browse files Browse the repository at this point in the history
  • Loading branch information
bgezer committed Jun 6, 2024
1 parent 0e21269 commit 73cab27
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
39 changes: 39 additions & 0 deletions src/highlight.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { styleTags, tags as t } from "@lezer/highlight";

export const groovyHighlighting = styleTags({
null: t.null,
instanceof: t.operatorKeyword,
this: t.self,
"new super assert open to with void": t.keyword,
"class interface extends implements enum var": t.definitionKeyword,
"module package import": t.moduleKeyword,
"switch while for if else case default do break continue return try catch finally throw":
t.controlKeyword,
["requires exports opens uses provides public private protected static transitive abstract final " +
"strictfp synchronized native transient volatile throws"]: t.modifier,
IntegerLiteral: t.integer,
FloatingPointLiteral: t.float,
"StringLiteral TextBlock": t.string,
CharacterLiteral: t.character,
LineComment: t.lineComment,
BlockComment: t.blockComment,
BooleanLiteral: t.bool,
PrimitiveType: t.standard(t.typeName),
TypeName: t.typeName,
Identifier: t.variableName,
"MethodName/Identifier": t.function(t.variableName),
Definition: t.definition(t.variableName),
ArithOp: t.arithmeticOperator,
LogicOp: t.logicOperator,
BitOp: t.bitwiseOperator,
CompareOp: t.compareOperator,
AssignOp: t.definitionOperator,
UpdateOp: t.updateOperator,
Asterisk: t.punctuation,
Label: t.labelName,
"( )": t.paren,
"[ ]": t.squareBracket,
"{ }": t.brace,
".": t.derefOperator,
", ;": t.separator,
});
2 changes: 1 addition & 1 deletion src/syntax.grammar
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,6 @@ commaSepTrailing<expr> { (expr ("," expr?)*)? }
"{" "}" "(" ")" "[" "]" "." "," ";" ":"
}

@external propSource javaHighlighting from "./highlight"
@external propSource groovyHighlighting from "./highlight"

@detectDelim

0 comments on commit 73cab27

Please sign in to comment.