java.lang.Object
org.aya.cli.literate.SyntaxHighlight
- All Implemented Interfaces:
Function<org.aya.concrete.stmt.Stmt,,kala.collection.mutable.MutableList<HighlightInfo>> org.aya.concrete.visitor.ExprFolder<kala.collection.mutable.MutableList<HighlightInfo>>,org.aya.concrete.visitor.PatternFolder<kala.collection.mutable.MutableList<HighlightInfo>>,org.aya.concrete.visitor.StmtFolder<kala.collection.mutable.MutableList<HighlightInfo>>
public class SyntaxHighlight
extends Object
implements org.aya.concrete.visitor.StmtFolder<kala.collection.mutable.MutableList<HighlightInfo>>
- Implementation Note:
- Use
MutableListinstead ofSeqViewfor performance consideration.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final @NotNull com.intellij.psi.tree.TokenSet -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull kala.collection.mutable.MutableList<HighlightInfo>fold(@NotNull kala.collection.mutable.MutableList<HighlightInfo> acc, @NotNull org.aya.concrete.Expr expr) @NotNull kala.collection.mutable.MutableList<HighlightInfo>fold(@NotNull kala.collection.mutable.MutableList<HighlightInfo> acc, @NotNull org.aya.concrete.Pattern pat) @NotNull kala.collection.mutable.MutableList<HighlightInfo>foldModuleDecl(@NotNull kala.collection.mutable.MutableList<HighlightInfo> acc, @NotNull org.aya.util.error.SourcePos pos, @NotNull org.aya.resolve.context.ModuleName path) @NotNull kala.collection.mutable.MutableList<HighlightInfo>foldModuleRef(@NotNull kala.collection.mutable.MutableList<HighlightInfo> acc, @NotNull org.aya.util.error.SourcePos pos, @NotNull org.aya.resolve.context.ModuleName path) @NotNull kala.collection.mutable.MutableList<HighlightInfo>foldVarDecl(@NotNull kala.collection.mutable.MutableList<HighlightInfo> acc, @NotNull org.aya.ref.AnyVar var, @NotNull org.aya.util.error.SourcePos pos, @NotNull kala.value.LazyValue<@Nullable org.aya.core.term.Term> type) @NotNull kala.collection.mutable.MutableList<HighlightInfo>foldVarRef(@NotNull kala.collection.mutable.MutableList<HighlightInfo> acc, @NotNull org.aya.ref.AnyVar var, @NotNull org.aya.util.error.SourcePos pos, @NotNull kala.value.LazyValue<@Nullable org.aya.core.term.Term> type) static @NotNull kala.collection.immutable.ImmutableSeq<HighlightInfo>highlight(@NotNull kala.control.Option<org.aya.util.error.SourceFile> sourceFile, @NotNull kala.collection.immutable.ImmutableSeq<org.aya.concrete.stmt.Stmt> program) @NotNull kala.collection.mutable.MutableList<HighlightInfo>init()static @NotNull HighlightInfo.DefKindkindOf(@NotNull org.aya.ref.AnyVar var) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.aya.concrete.visitor.ExprFolder
foldParamDecl, withTermTypeMethods inherited from interface org.aya.concrete.visitor.PatternFolder
apply, foldVar, lazyType, noType, varTypeMethods inherited from interface org.aya.concrete.visitor.StmtFolder
apply, fold, fold
-
Field Details
-
SPECIAL_SYMBOL
@NotNull public static final @NotNull com.intellij.psi.tree.TokenSet SPECIAL_SYMBOL
-
-
Constructor Details
-
SyntaxHighlight
public SyntaxHighlight()
-
-
Method Details
-
highlight
@NotNull public static @NotNull kala.collection.immutable.ImmutableSeq<HighlightInfo> highlight(@NotNull @NotNull kala.control.Option<org.aya.util.error.SourceFile> sourceFile, @NotNull @NotNull kala.collection.immutable.ImmutableSeq<org.aya.concrete.stmt.Stmt> program) - Parameters:
sourceFile- If not null, provide keyword highlights too- Returns:
- a list of
HighlightInfo, no order was expected, the elements may be duplicated
-
init
- Specified by:
initin interfaceorg.aya.concrete.visitor.ExprFolder<kala.collection.mutable.MutableList<HighlightInfo>>- Specified by:
initin interfaceorg.aya.concrete.visitor.PatternFolder<kala.collection.mutable.MutableList<HighlightInfo>>
-
foldVarRef
@NotNull public @NotNull kala.collection.mutable.MutableList<HighlightInfo> foldVarRef(@NotNull @NotNull kala.collection.mutable.MutableList<HighlightInfo> acc, @NotNull @NotNull org.aya.ref.AnyVar var, @NotNull @NotNull org.aya.util.error.SourcePos pos, @NotNull @NotNull kala.value.LazyValue<@Nullable org.aya.core.term.Term> type) - Specified by:
foldVarRefin interfaceorg.aya.concrete.visitor.PatternFolder<kala.collection.mutable.MutableList<HighlightInfo>>
-
foldVarDecl
@NotNull public @NotNull kala.collection.mutable.MutableList<HighlightInfo> foldVarDecl(@NotNull @NotNull kala.collection.mutable.MutableList<HighlightInfo> acc, @NotNull @NotNull org.aya.ref.AnyVar var, @NotNull @NotNull org.aya.util.error.SourcePos pos, @NotNull @NotNull kala.value.LazyValue<@Nullable org.aya.core.term.Term> type) - Specified by:
foldVarDeclin interfaceorg.aya.concrete.visitor.PatternFolder<kala.collection.mutable.MutableList<HighlightInfo>>
-
fold
@NotNull public @NotNull kala.collection.mutable.MutableList<HighlightInfo> fold(@NotNull @NotNull kala.collection.mutable.MutableList<HighlightInfo> acc, @NotNull @NotNull org.aya.concrete.Expr expr) - Specified by:
foldin interfaceorg.aya.concrete.visitor.ExprFolder<kala.collection.mutable.MutableList<HighlightInfo>>
-
fold
@NotNull public @NotNull kala.collection.mutable.MutableList<HighlightInfo> fold(@NotNull @NotNull kala.collection.mutable.MutableList<HighlightInfo> acc, @NotNull @NotNull org.aya.concrete.Pattern pat) - Specified by:
foldin interfaceorg.aya.concrete.visitor.PatternFolder<kala.collection.mutable.MutableList<HighlightInfo>>
-
foldModuleRef
@NotNull public @NotNull kala.collection.mutable.MutableList<HighlightInfo> foldModuleRef(@NotNull @NotNull kala.collection.mutable.MutableList<HighlightInfo> acc, @NotNull @NotNull org.aya.util.error.SourcePos pos, @NotNull @NotNull org.aya.resolve.context.ModuleName path) - Specified by:
foldModuleRefin interfaceorg.aya.concrete.visitor.StmtFolder<kala.collection.mutable.MutableList<HighlightInfo>>
-
foldModuleDecl
@NotNull public @NotNull kala.collection.mutable.MutableList<HighlightInfo> foldModuleDecl(@NotNull @NotNull kala.collection.mutable.MutableList<HighlightInfo> acc, @NotNull @NotNull org.aya.util.error.SourcePos pos, @NotNull @NotNull org.aya.resolve.context.ModuleName path) - Specified by:
foldModuleDeclin interfaceorg.aya.concrete.visitor.StmtFolder<kala.collection.mutable.MutableList<HighlightInfo>>
-
kindOf
@NotNull public static @NotNull HighlightInfo.DefKind kindOf(@NotNull @NotNull org.aya.ref.AnyVar var)
-