Parse binary XOR tokens

This commit is contained in:
Sasha Koshka 2022-08-30 01:33:58 -04:00
parent 05954546eb
commit 067729d435

View File

@ -348,6 +348,17 @@ func (lexer *LexingOperation) tokenizeSymbolBeginning () (err error) {
token.location.SetWidth(2) token.location.SetWidth(2)
} }
lexer.addToken(token) 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: default:
err = infoerr.NewError ( err = infoerr.NewError (
lexer.file.Location(1), lexer.file.Location(1),