Allow identifiers to start with an underscore

This commit is contained in:
Deukhoofd 2018-11-20 14:23:50 +01:00
parent 8f6d2591f3
commit 2f8c295675
No known key found for this signature in database
GPG Key ID: B4C087AC81641654
1 changed files with 1 additions and 1 deletions

View File

@ -95,7 +95,7 @@ namespace Upsilon.Parser
}
return new SyntaxToken(SyntaxKind.Tilde, _position, "~", null);
default:
if (char.IsLetter(Current))
if (char.IsLetter(Current) || Current == '_')
return LexIdentifierOrKeyword();
_diagnostics.LogBadCharacter(new TextSpan(_position, 1), SyntaxKind.Identifier);
return new SyntaxToken(SyntaxKind.BadToken, _position, "", null);