From 222e0aad08a49aa4cc143b99abbd6facf321c0ff Mon Sep 17 00:00:00 2001 From: Greg Shuflin Date: Wed, 17 Nov 2021 04:43:02 -0800 Subject: [PATCH] Use location --- schala-lang/src/parsing/combinator.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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) }