2024-07-08 16:47:30 -07:00
|
|
|
import { styleTags, tags as t } from '@lezer/highlight'
|
|
|
|
|
2024-08-17 14:15:11 -07:00
|
|
|
export const kclHighlight = styleTags({
|
2024-10-17 00:48:33 -04:00
|
|
|
'import export': t.moduleKeyword,
|
|
|
|
ImportItemAs: t.definitionKeyword,
|
|
|
|
ImportFrom: t.moduleKeyword,
|
2024-07-08 16:47:30 -07:00
|
|
|
'fn var let const': t.definitionKeyword,
|
2024-10-04 08:34:09 -04:00
|
|
|
'if else': t.controlKeyword,
|
2024-07-08 16:47:30 -07:00
|
|
|
return: t.controlKeyword,
|
|
|
|
'true false': t.bool,
|
|
|
|
nil: t.null,
|
|
|
|
'AddOp MultOp ExpOp': t.arithmeticOperator,
|
2024-08-14 02:38:37 -04:00
|
|
|
BangOp: t.logicOperator,
|
2024-10-17 19:29:13 -04:00
|
|
|
CompOp: t.compareOperator,
|
2024-12-16 17:33:08 -05:00
|
|
|
LogicOp: t.logicOperator,
|
2024-07-08 16:47:30 -07:00
|
|
|
'Equals Arrow': t.definitionOperator,
|
|
|
|
PipeOperator: t.controlOperator,
|
|
|
|
String: t.string,
|
|
|
|
Number: t.number,
|
|
|
|
LineComment: t.lineComment,
|
|
|
|
BlockComment: t.blockComment,
|
|
|
|
Shebang: t.meta,
|
2025-02-19 20:17:18 -05:00
|
|
|
AnnotationName: t.annotation,
|
2024-07-08 16:47:30 -07:00
|
|
|
PipeSubstitution: t.atom,
|
|
|
|
VariableDefinition: t.definition(t.variableName),
|
|
|
|
VariableName: t.variableName,
|
|
|
|
PropertyName: t.propertyName,
|
2025-02-19 20:17:18 -05:00
|
|
|
'AnnotationProperty/PropertyName': t.definition(t.propertyName),
|
|
|
|
'ObjectProperty/PropertyName': t.definition(t.propertyName),
|
|
|
|
'LabeledArgument/ArgumentLabel': t.definition(t.propertyName),
|
2024-07-08 16:47:30 -07:00
|
|
|
TagDeclarator: t.tagName,
|
|
|
|
'( )': t.paren,
|
|
|
|
'{ }': t.brace,
|
|
|
|
'[ ]': t.bracket,
|
|
|
|
', . : ? ..': t.punctuation,
|
|
|
|
})
|