From f3b25526794987b45b79bf1b9ce5a90397620e2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Mon, 2 Jan 2023 09:59:37 +0100 Subject: [PATCH] Tokens - Address ('@') token for loop labels --- src/scanner.rs | 1 + src/tokens.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/scanner.rs b/src/scanner.rs index 64d147c..935d555 100644 --- a/src/scanner.rs +++ b/src/scanner.rs @@ -87,6 +87,7 @@ impl Scanner { '+' => self.add_token(TokenType::Plus), ';' => self.add_token(TokenType::Semicolon), '*' => self.add_token(TokenType::Star), + '@' => self.add_token(TokenType::Address), // Slash is a special case as it may be a line comment '/' => { if self.is_match('/') { diff --git a/src/tokens.rs b/src/tokens.rs index d5c3d01..98a413d 100644 --- a/src/tokens.rs +++ b/src/tokens.rs @@ -5,6 +5,7 @@ pub enum TokenType { RightParen, LeftBrace, RightBrace, + Address, Comma, Dot, Minus,