From 9ee4dc49ee9275ee1866915066bdda4e96d9286c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C5=BD=C3=A1dn=C3=ADk?= Date: Sun, 26 Sep 2021 23:58:30 +0300 Subject: [PATCH] Fix wrong error span --- crates/nu-parser/src/parse_keywords.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/nu-parser/src/parse_keywords.rs b/crates/nu-parser/src/parse_keywords.rs index e7bcb38a3b..9120ac6cc8 100644 --- a/crates/nu-parser/src/parse_keywords.rs +++ b/crates/nu-parser/src/parse_keywords.rs @@ -287,7 +287,10 @@ pub fn parse_module( } _ => ( garbage_statement(&pipeline.commands[0].parts), - Some(ParseError::Expected("def".into(), block_span)), + Some(ParseError::Expected( + "def".into(), + pipeline.commands[0].parts[0], + )), ), };