diff options
| author | Marmare314 <49279081+Marmare314@users.noreply.github.com> | 2023-04-20 11:05:11 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-20 11:05:11 +0200 |
| commit | 4524539c2bc5f3a9f53bc57a1902264fc894969b (patch) | |
| tree | 578dcc6b82b0d40d88eb5d6a6f07cbdc38ef10d0 /src/syntax/lexer.rs | |
| parent | c505a0f5dccd120d97926f6ff5bbe0becf783aeb (diff) | |
forbid underscore as identifier closes #513 (#837)
Diffstat (limited to 'src/syntax/lexer.rs')
| -rw-r--r-- | src/syntax/lexer.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/syntax/lexer.rs b/src/syntax/lexer.rs index dcd2509a..dc75a902 100644 --- a/src/syntax/lexer.rs +++ b/src/syntax/lexer.rs @@ -527,7 +527,11 @@ impl Lexer<'_> { } } - SyntaxKind::Ident + if ident == "_" { + SyntaxKind::Underscore + } else { + SyntaxKind::Ident + } } fn number(&mut self, mut start: usize, c: char) -> SyntaxKind { |
