///|
test {
let st = @span.SourceText::new("string Foo\nstring Bar\n", name="a.smithy")
let at = @span.Offset::new(11).unwrap()
debug_inspect(st.position(at), content="{ line: Line(2), column: Column(1) }")
debug_inspect(
st.line_text(@span.Line::first().next()),
content="Some(\"string Bar\")",
)
}pub struct SourceText {
// private fields
}Install
Download zipSmithy IDL syntax for MoonBit: lossless scanner, typed AST, CST, parser and diagnostics
Dependencies