diff --git a/schala-lang/src/parsing/combinator.rs b/schala-lang/src/parsing/combinator.rs index d695dfd..a0a4f9c 100644 --- a/schala-lang/src/parsing/combinator.rs +++ b/schala-lang/src/parsing/combinator.rs @@ -91,10 +91,11 @@ fn block(input: Span) -> ParseResult { } fn statement(input: Span) -> ParseResult { + 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) }