Fixed wrong error location reporting

This commit is contained in:
Deukhoofd 2018-12-07 19:29:09 +01:00
parent eb1eb81c1b
commit 229fe3bffa
No known key found for this signature in database
GPG Key ID: B4C087AC81641654
1 changed files with 2 additions and 2 deletions

View File

@ -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;