Add logical xor (#357)

This commit is contained in:
John 2021-09-18 19:39:35 +09:00 committed by GitHub
parent a8901becc3
commit 014b82f03d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 83 additions and 0 deletions

View file

@ -898,6 +898,7 @@ impl<'a> Parser<'a> {
None
}
}
Keyword::XOR => Some(BinaryOperator::Xor),
_ => None,
},
_ => None,
@ -1018,6 +1019,7 @@ impl<'a> Parser<'a> {
match token {
Token::Word(w) if w.keyword == Keyword::OR => Ok(5),
Token::Word(w) if w.keyword == Keyword::AND => Ok(10),
Token::Word(w) if w.keyword == Keyword::XOR => Ok(24),
Token::Word(w) if w.keyword == Keyword::NOT => match self.peek_nth_token(1) {
// The precedence of NOT varies depending on keyword that
// follows it. If it is followed by IN, BETWEEN, or LIKE,