kdleam/error

KDL v2 の解析エラーを表す。

Types

行、列、エラーの種類を持つ。kdleam.parse が返す行と列は 1 始まりである。

pub type KdlError {
  KdlError(line: Int, col: Int, kind: KdlErrorKind)
}

Constructors

エラータグを保持する。

pub type KdlErrorKind {
  KdlErrorKind(tag: KdlErrorTag)
}

Constructors

解析で起こる 12 種類の失敗を表す。

pub type KdlErrorTag {
  UnexpectedChar(String)
  UnexpectedEof
  InvalidEscape
  InvalidUnicodeEscape
  InvalidNumber
  DisallowedCodePoint(String)
  BareKeyword
  UnmatchedBlockCommentEnd
  UnclosedBlockComment
  UnclosedString
  InconsistentIndentation
  InvalidSlashdash
}

Constructors

  • UnexpectedChar(String)
  • UnexpectedEof
  • InvalidEscape
  • InvalidUnicodeEscape
  • InvalidNumber
  • DisallowedCodePoint(String)
  • BareKeyword
  • UnmatchedBlockCommentEnd
  • UnclosedBlockComment
  • UnclosedString
  • InconsistentIndentation
  • InvalidSlashdash

Values

pub fn make(line: Int, col: Int, tag: KdlErrorTag) -> KdlError

指定した行、列、タグを保持するエラーを作る。

pub fn unexpected_char(
  line: Int,
  col: Int,
  ch: String,
) -> KdlError

指定した行、列、文字を保持するエラーを作る。

pub fn unexpected_eof(line: Int, col: Int) -> KdlError

指定した行と列を保持する入力終端のエラーを作る。

Search Document