java.lang.Object
java.lang.Record
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 record SyntaxHighlight(@Nullable kala.collection.immutable.ImmutableSeq<String> currentFileModule)
extends Record
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
ConstructorsConstructorDescriptionSyntaxHighlight(@Nullable kala.collection.immutable.ImmutableSeq<String> currentFileModule) Creates an instance of aSyntaxHighlightrecord class. -
Method Summary
Modifier and TypeMethodDescription@Nullable kala.collection.immutable.ImmutableSeq<String>Returns the value of thecurrentFileModulerecord component.final booleanIndicates whether some other object is "equal to" this one.@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) final inthashCode()Returns a hash code value for this object.static @NotNull kala.collection.immutable.ImmutableSeq<HighlightInfo>highlight(@Nullable kala.collection.immutable.ImmutableSeq<String> currentFileModule, @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) final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, 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(@Nullable @Nullable kala.collection.immutable.ImmutableSeq<String> currentFileModule) Creates an instance of aSyntaxHighlightrecord class.- Parameters:
currentFileModule- the value for thecurrentFileModulerecord component
-
-
Method Details
-
highlight
@NotNull public static @NotNull kala.collection.immutable.ImmutableSeq<HighlightInfo> highlight(@Nullable @Nullable kala.collection.immutable.ImmutableSeq<String> currentFileModule, @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) -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
currentFileModule
Returns the value of thecurrentFileModulerecord component.- Returns:
- the value of the
currentFileModulerecord component
-