Add && + || as alternatives for AND + OR in SQL
This commit is contained in:
parent
e0bcd5ff37
commit
6e4a229a96
1 changed files with 16 additions and 0 deletions
|
@ -128,6 +128,22 @@ func (s *scanner) scan() (tok Token, lit string, val interface{}) {
|
||||||
return NONECONTAINEDIN, string(ch), val
|
return NONECONTAINEDIN, string(ch), val
|
||||||
case '#':
|
case '#':
|
||||||
return s.scanCommentSingle(ch)
|
return s.scanCommentSingle(ch)
|
||||||
|
case '|':
|
||||||
|
chn := s.next()
|
||||||
|
switch {
|
||||||
|
case chn == '|':
|
||||||
|
return OR, "OR", val
|
||||||
|
default:
|
||||||
|
s.undo()
|
||||||
|
}
|
||||||
|
case '&':
|
||||||
|
chn := s.next()
|
||||||
|
switch {
|
||||||
|
case chn == '&':
|
||||||
|
return AND, "AND", val
|
||||||
|
default:
|
||||||
|
s.undo()
|
||||||
|
}
|
||||||
case '/':
|
case '/':
|
||||||
chn := s.next()
|
chn := s.next()
|
||||||
switch {
|
switch {
|
||||||
|
|
Loading…
Reference in a new issue