Module aya.cli.impl

Record Class SyntaxHighlight

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

    Fields
    Modifier and Type
    Field
    Description
    static final @NotNull com.intellij.psi.tree.TokenSet
     

    Fields inherited from interface org.aya.syntax.concrete.stmt.StmtVisitor

    noType
  • Constructor Summary

    Constructors
    Constructor
    Description
    SyntaxHighlight(@Nullable org.aya.syntax.ref.ModulePath currentFileModule, @NotNull kala.collection.mutable.MutableList<HighlightInfo> info)
    Creates an instance of a SyntaxHighlight record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable org.aya.syntax.ref.ModulePath
    Returns the value of the currentFileModule record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    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>
    Returns the value of the info record component.
    static @NotNull HighlightInfo.DefKind
    kindOf(@NotNull org.aya.syntax.ref.AnyVar var)
     
    final String
    Returns a string representation of this record class.
    void
    visitExpr(@NotNull org.aya.util.error.SourcePos pos, @NotNull org.aya.syntax.concrete.Expr expr)
     
    void
    visitModuleDecl(@NotNull org.aya.util.error.SourcePos pos, @NotNull org.aya.syntax.concrete.stmt.ModuleName path)
     
    void
    visitModuleRef(@NotNull org.aya.util.error.SourcePos pos, @NotNull org.aya.syntax.concrete.stmt.ModuleName path)
     
    void
    visitModuleRef(@NotNull org.aya.util.error.SourcePos pos, @NotNull org.aya.syntax.ref.ModulePath path)
     
    void
    visitPattern(@NotNull org.aya.util.error.SourcePos pos, @NotNull org.aya.syntax.concrete.Pattern pat)
     
    void
    visitVarDecl(@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)
     
    void
    visitVarRef(@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, wait

    Methods inherited from interface java.util.function.Consumer

    andThen

    Methods inherited from interface org.aya.syntax.concrete.stmt.StmtVisitor

    accept, visit, 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 a SyntaxHighlight record class.
      Parameters:
      currentFileModule - the value for the currentFileModule record component
      info - the value for the info record 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
    • 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:
      visitVarRef in interface org.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:
      visitExpr in interface org.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:
      visitPattern in interface org.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:
      visitVarDecl in interface org.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:
      visitModuleRef in interface org.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:
      visitModuleRef in interface org.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:
      visitModuleDecl in interface org.aya.syntax.concrete.stmt.StmtVisitor
    • kindOf

      @NotNull public static @NotNull HighlightInfo.DefKind kindOf(@NotNull @NotNull org.aya.syntax.ref.AnyVar var)
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • currentFileModule

      @Nullable public @Nullable org.aya.syntax.ref.ModulePath currentFileModule()
      Returns the value of the currentFileModule record component.
      Returns:
      the value of the currentFileModule record component
    • info

      @NotNull public @NotNull kala.collection.mutable.MutableList<HighlightInfo> info()
      Returns the value of the info record component.
      Returns:
      the value of the info record component