From 2f8c2956754afa558dc1dd719c7aa24c64bcf23c Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Tue, 20 Nov 2018 14:23:50 +0100 Subject: [PATCH] Allow identifiers to start with an underscore --- Upsilon/Parser/Lexer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Upsilon/Parser/Lexer.cs b/Upsilon/Parser/Lexer.cs index d8b62d0..c2edbd6 100644 --- a/Upsilon/Parser/Lexer.cs +++ b/Upsilon/Parser/Lexer.cs @@ -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);