From 229fe3bffa95a8aba3c807743eadf984a1bf79f5 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Fri, 7 Dec 2018 19:29:09 +0100 Subject: [PATCH] Fixed wrong error location reporting --- Upsilon/Parser/Parser.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Upsilon/Parser/Parser.cs b/Upsilon/Parser/Parser.cs index ea02522..5e14b97 100644 --- a/Upsilon/Parser/Parser.cs +++ b/Upsilon/Parser/Parser.cs @@ -458,9 +458,9 @@ namespace Upsilon.Parser expression = new LiteralExpressionSyntax(nilToken, null); break; default: - _diagnostics.LogBadCharacter(new TextSpan(_position, 1)); + _diagnostics.LogBadCharacter(Current.Span); + expression = new BadExpressionSyntax(Current.Span); NextToken(); - expression = new BadExpressionSyntax(new TextSpan(_position, 1)); break; } return expression;