diff --git a/lexer/annotations.py b/lexer/annotations.py index 3ee18af..ae9faae 100644 --- a/lexer/annotations.py +++ b/lexer/annotations.py @@ -28,7 +28,7 @@ class AnnotationLexer(Lexer): TokenType.EQUAL_EQUAL if self.match("=") else TokenType.EQUAL ) case "!": - if self.peek() == "=": + if self.match("="): self.add_token(TokenType.BANG_EQUAL) else: self.error("Unexpected single bang. Did you mean '!=' ?") diff --git a/lexer/midas.py b/lexer/midas.py index 42d8e6b..ad29a68 100644 --- a/lexer/midas.py +++ b/lexer/midas.py @@ -32,7 +32,7 @@ class MidasLexer(Lexer): TokenType.EQUAL_EQUAL if self.match("=") else TokenType.EQUAL ) case "!": - if self.peek() == "=": + if self.match("="): self.add_token(TokenType.BANG_EQUAL) else: self.error("Unexpected single bang. Did you mean '!=' ?")