kdleam/error
KDL v2 の解析エラーを表す。
Types
行、列、エラーの種類を持つ。kdleam.parse が返す行と列は 1 始まりである。
pub type KdlError {
KdlError(line: Int, col: Int, kind: KdlErrorKind)
}
Constructors
-
KdlError(line: Int, col: Int, kind: KdlErrorKind)
エラータグを保持する。
pub type KdlErrorKind {
KdlErrorKind(tag: KdlErrorTag)
}
Constructors
-
KdlErrorKind(tag: KdlErrorTag)
解析で起こる 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 unexpected_char(
line: Int,
col: Int,
ch: String,
) -> KdlError
指定した行、列、文字を保持するエラーを作る。