Tokens - Address ('@') token for loop labels

This commit is contained in:
Emmanuel BENOîT 2023-01-02 09:59:37 +01:00
parent 48b86d5087
commit f3b2552679
2 changed files with 2 additions and 0 deletions

View file

@ -87,6 +87,7 @@ impl Scanner {
'+' => self.add_token(TokenType::Plus), '+' => self.add_token(TokenType::Plus),
';' => self.add_token(TokenType::Semicolon), ';' => self.add_token(TokenType::Semicolon),
'*' => self.add_token(TokenType::Star), '*' => self.add_token(TokenType::Star),
'@' => self.add_token(TokenType::Address),
// Slash is a special case as it may be a line comment // Slash is a special case as it may be a line comment
'/' => { '/' => {
if self.is_match('/') { if self.is_match('/') {

View file

@ -5,6 +5,7 @@ pub enum TokenType {
RightParen, RightParen,
LeftBrace, LeftBrace,
RightBrace, RightBrace,
Address,
Comma, Comma,
Dot, Dot,
Minus, Minus,