///|
priv struct YamlLine {
indent : Int
content : String
line : Int
}
///|
priv struct YamlState {
lines : Array[YamlLine]
index : Array[Int]
diagnostics : Array[Diagnostic]
}
///|
pub struct YamlParseResult {
value : JsonValue?
diagnostics : DiagnosticBag
} derive(Debug, Eq)
///|
fn YamlState::error(
self : YamlState,
line : YamlLine,
message : String,
) -> Unit {
self.diagnostics.push(
Diagnostic::error(
"yaml",
message,
Some(SourceLocation::new(line.line, line.indent + 1, 0)),
),
)
}