java.lang.Object
java.lang.Record
org.aya.cli.literate.SyntaxHighlight
- All Implemented Interfaces:
Consumer<org.aya.syntax.concrete.stmt.Stmt>,org.aya.syntax.concrete.stmt.StmtVisitor
public record SyntaxHighlight(@Nullable org.aya.syntax.ref.ModulePath currentFileModule, @NotNull kala.collection.mutable.MutableList<HighlightInfo> info)
extends Record
implements org.aya.syntax.concrete.stmt.StmtVisitor
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final @NotNull com.intellij.psi.tree.TokenSetFields inherited from interface org.aya.syntax.concrete.stmt.StmtVisitor
noType -
Constructor Summary
ConstructorsConstructorDescriptionSyntaxHighlight(@Nullable org.aya.syntax.ref.ModulePath currentFileModule, @NotNull kala.collection.mutable.MutableList<HighlightInfo> info) Creates an instance of aSyntaxHighlightrecord class. -
Method Summary
Modifier and TypeMethodDescription@Nullable org.aya.syntax.ref.ModulePathReturns the value of thecurrentFileModulerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static @NotNull kala.collection.immutable.ImmutableSeq<HighlightInfo> highlight(@Nullable org.aya.syntax.ref.ModulePath currentFileModule, @NotNull kala.control.Option<org.aya.util.error.SourceFile> sourceFile, @NotNull kala.collection.immutable.ImmutableSeq<org.aya.syntax.concrete.stmt.Stmt> program) @NotNull kala.collection.mutable.MutableList<HighlightInfo> info()Returns the value of theinforecord component.static @NotNull HighlightInfo.DefKindkindOf(@NotNull org.aya.syntax.ref.AnyVar var) static @NotNull kala.collection.immutable.ImmutableSeq<@NotNull HighlightInfo.Lit> lexicalHighlight(@NotNull org.aya.util.error.SourceFile file) final StringtoString()Returns a string representation of this record class.voidvisitExpr(@NotNull org.aya.util.error.SourcePos pos, @NotNull org.aya.syntax.concrete.Expr expr) voidvisitModuleDecl(@NotNull org.aya.util.error.SourcePos pos, @NotNull org.aya.syntax.concrete.stmt.ModuleName path) voidvisitModuleRef(@NotNull org.aya.util.error.SourcePos pos, @NotNull org.aya.syntax.concrete.stmt.ModuleName path) voidvisitModuleRef(@NotNull org.aya.util.error.SourcePos pos, @NotNull org.aya.syntax.ref.ModulePath path) voidvisitPattern(@NotNull org.aya.util.error.SourcePos pos, @NotNull org.aya.syntax.concrete.Pattern pat) voidvisitVarDecl(@NotNull org.aya.util.error.SourcePos pos, @NotNull org.aya.syntax.ref.AnyVar var, @NotNull kala.value.LazyValue<@Nullable org.aya.syntax.core.term.Term> type) voidvisitVarRef(@NotNull org.aya.util.error.SourcePos pos, @NotNull org.aya.syntax.ref.AnyVar var, @NotNull kala.value.LazyValue<@Nullable org.aya.syntax.core.term.Term> type) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.aya.syntax.concrete.stmt.StmtVisitor
accept, visit, visitLocalVarDecl, visitParamDecl, visitTelescopic, visitVar
-
Field Details
-
SPECIAL_SYMBOL
@NotNull public static final @NotNull com.intellij.psi.tree.TokenSet SPECIAL_SYMBOL
-
-
Constructor Details
-
SyntaxHighlight
public SyntaxHighlight(@Nullable @Nullable org.aya.syntax.ref.ModulePath currentFileModule, @NotNull @NotNull kala.collection.mutable.MutableList<HighlightInfo> info) Creates an instance of aSyntaxHighlightrecord class.- Parameters:
currentFileModule- the value for thecurrentFileModulerecord componentinfo- the value for theinforecord component
-
-
Method Details
-
highlight
@NotNull public static @NotNull kala.collection.immutable.ImmutableSeq<HighlightInfo> highlight(@Nullable @Nullable org.aya.syntax.ref.ModulePath currentFileModule, @NotNull @NotNull kala.control.Option<org.aya.util.error.SourceFile> sourceFile, @NotNull @NotNull kala.collection.immutable.ImmutableSeq<org.aya.syntax.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
-
lexicalHighlight
@NotNull public static @NotNull kala.collection.immutable.ImmutableSeq<@NotNull HighlightInfo.Lit> lexicalHighlight(@NotNull @NotNull org.aya.util.error.SourceFile file) -
visitVarRef
public void visitVarRef(@NotNull @NotNull org.aya.util.error.SourcePos pos, @NotNull @NotNull org.aya.syntax.ref.AnyVar var, @NotNull @NotNull kala.value.LazyValue<@Nullable org.aya.syntax.core.term.Term> type) - Specified by:
visitVarRefin interfaceorg.aya.syntax.concrete.stmt.StmtVisitor
-
visitExpr
public void visitExpr(@NotNull @NotNull org.aya.util.error.SourcePos pos, @NotNull @NotNull org.aya.syntax.concrete.Expr expr) - Specified by:
visitExprin interfaceorg.aya.syntax.concrete.stmt.StmtVisitor
-
visitPattern
public void visitPattern(@NotNull @NotNull org.aya.util.error.SourcePos pos, @NotNull @NotNull org.aya.syntax.concrete.Pattern pat) - Specified by:
visitPatternin interfaceorg.aya.syntax.concrete.stmt.StmtVisitor
-
visitVarDecl
public void visitVarDecl(@NotNull @NotNull org.aya.util.error.SourcePos pos, @NotNull @NotNull org.aya.syntax.ref.AnyVar var, @NotNull @NotNull kala.value.LazyValue<@Nullable org.aya.syntax.core.term.Term> type) - Specified by:
visitVarDeclin interfaceorg.aya.syntax.concrete.stmt.StmtVisitor
-
visitModuleRef
public void visitModuleRef(@NotNull @NotNull org.aya.util.error.SourcePos pos, @NotNull @NotNull org.aya.syntax.ref.ModulePath path) - Specified by:
visitModuleRefin interfaceorg.aya.syntax.concrete.stmt.StmtVisitor
-
visitModuleRef
public void visitModuleRef(@NotNull @NotNull org.aya.util.error.SourcePos pos, @NotNull @NotNull org.aya.syntax.concrete.stmt.ModuleName path) - Specified by:
visitModuleRefin interfaceorg.aya.syntax.concrete.stmt.StmtVisitor
-
visitModuleDecl
public void visitModuleDecl(@NotNull @NotNull org.aya.util.error.SourcePos pos, @NotNull @NotNull org.aya.syntax.concrete.stmt.ModuleName path) - Specified by:
visitModuleDeclin interfaceorg.aya.syntax.concrete.stmt.StmtVisitor
-
kindOf
@NotNull public static @NotNull HighlightInfo.DefKind kindOf(@NotNull @NotNull org.aya.syntax.ref.AnyVar var) -
toString
-
hashCode
-
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
@Nullable public @Nullable org.aya.syntax.ref.ModulePath currentFileModule()Returns the value of thecurrentFileModulerecord component.- Returns:
- the value of the
currentFileModulerecord component
-
info
Returns the value of theinforecord component.- Returns:
- the value of the
inforecord component
-