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: @internal Span,
    expected: String,
    found: String,
  )
  Semantic(span: @internal Span, message: String)
  Lexical(span: @internal Span, message: String)
}

Constructors

  • Unexpected(span: @internal Span, expected: String, found: String)
  • Semantic(span: @internal Span, message: String)
  • Lexical(span: @internal Span, message: String)

Values

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