TorchLean API

NN.Tensor.Internal.Syntax.Diagnostic

Parser diagnostics #

Diagnostics carry a stable machine-readable code, a human-readable message, and the smallest useful source span.

Stable categories for syntax errors.

  • unknownCharacter : DiagnosticCode

    The lexer encountered a character outside the einops token alphabet.

  • missingArrow : DiagnosticCode

    A pattern that requires -> did not contain one.

  • duplicateArrow : DiagnosticCode

    A pattern contained more than one ->.

  • unexpectedToken : DiagnosticCode

    A token was not valid at its position in the current grammar.

  • unbalancedParenthesis : DiagnosticCode

    An opening or closing parenthesis had no matching partner.

  • nestedParenthesis : DiagnosticCode

    A parenthesized axis group contained another parenthesized group.

  • invalidIdentifier : DiagnosticCode

    A word did not satisfy the selected identifier policy.

  • duplicateAxis : DiagnosticCode

    A named axis occurred more than once where uniqueness is required.

  • invalidAnonymousAxis : DiagnosticCode

    A numeric axis was zero or could not be decoded as a natural number.

  • duplicateEllipsis : DiagnosticCode

    An expression contained more than one ellipsis.

  • missingPackAxis : DiagnosticCode

    A pack pattern did not contain its required * axis.

  • duplicatePackAxis : DiagnosticCode

    A pack pattern contained more than one * axis.

Instances For

    A structured syntax error.

    • Stable machine-readable category of the parse failure.

    • message : String

      Human-readable explanation of the malformed pattern.

    • span : Span

      Smallest useful source range responsible for the failure.

    Instances For
      @[reducible, inline]

      The result type used by the syntax front end.

      Instances For