Parse binary XOR tokens

This commit is contained in:
Sasha Koshka 2022-08-30 01:33:58 -04:00
parent 05954546eb
commit 067729d435
1 changed files with 11 additions and 0 deletions

View File

@ -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),