From 067729d43532d95446b27611a7b9f6aa904332f9 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Tue, 30 Aug 2022 01:33:58 -0400 Subject: [PATCH] Parse binary XOR tokens --- lexer/lexer.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lexer/lexer.go b/lexer/lexer.go index 08db5d1..0de6031 100644 --- a/lexer/lexer.go +++ b/lexer/lexer.go @@ -348,6 +348,17 @@ func (lexer *LexingOperation) tokenizeSymbolBeginning () (err error) { token.location.SetWidth(2) } lexer.addToken(token) + case '^': + token := lexer.newToken() + err = lexer.nextRune() + if err != nil { return } + token.kind = TokenKindBinaryXor + if lexer.char == '=' { + token.kind = TokenKindBinaryXorAssignment + err = lexer.nextRune() + token.location.SetWidth(2) + } + lexer.addToken(token) default: err = infoerr.NewError ( lexer.file.Location(1),