From: ahmedsamyh Date: Wed, 20 Nov 2024 03:51:47 +0000 (+0500) Subject: Token.value -> Token.lexeme X-Git-Url: https://www.git.momoyon.org/?a=commitdiff_plain;h=bb715422d661426b1906288d65536c6c4568f315;p=lang.git Token.value -> Token.lexeme --- diff --git a/main.py b/main.py index e1cf5f0..b071625 100644 --- a/main.py +++ b/main.py @@ -101,13 +101,13 @@ token_type_as_str_map: { TokenType : str } = { assert len(token_type_as_str_map) == TokenType.COUNT-1 class Token: - def __init__(self, typ: TokenType, value: str, loc: Loc): + def __init__(self, typ: TokenType, lexeme: str, loc: Loc): self.typ = typ - self.value = value + self.lexeme = lexeme self.loc = loc def __str__(self): - return f"Token ({token_type_as_str_map[self.typ]}, '{self.value}', {self.loc})" + return f"Token ({token_type_as_str_map[self.typ]}, '{self.lexeme}', {self.loc})" class Lexer: def __init__(self, filename: str):