atproto_sdl/error

Parse and lex error types plus describe, which renders a “line:col: expected X, found Y” message. Lexer failures surface as Lexical; everything the recursive-descent parser rejects surfaces as Unexpected (a token mismatch) or Semantic (a well-formed construct the target lexicon AST cannot represent, e.g. @nullable on a param).

Types

pub type ParseError {
  Unexpected(span: token.Span, expected: String, found: String)
  Semantic(span: token.Span, message: String)
  Lexical(span: token.Span, message: String)
}

Constructors

  • Unexpected(span: token.Span, expected: String, found: String)
  • Semantic(span: token.Span, message: String)
  • Lexical(span: token.Span, message: String)

Values

pub fn describe(error: ParseError) -> String
Search Document