Use location

This commit is contained in:
Greg Shuflin 2021-11-17 04:43:02 -08:00
parent 77030091bb
commit 222e0aad08

View File

@ -91,10 +91,11 @@ fn block(input: Span) -> ParseResult<Block> {
}
fn statement(input: Span) -> ParseResult<Statement> {
let pos: usize = position(input)?.1.location_offset();
context("Parsing-statement",
map(expression, |expr| Statement {
map(expression, move |expr| Statement {
id: Default::default(),
location: Default::default(),
location: pos.into(),
kind: StatementKind::Expression(expr),
}))(input)
}