Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

Commit

Permalink
revert removing 'not in' clause.
Browse files Browse the repository at this point in the history
  • Loading branch information
SteamShon committed Jun 18, 2018
1 parent 428c453 commit a7ed4e8
Showing 1 changed file with 10 additions and 4 deletions.
Expand Up @@ -190,8 +190,10 @@ case class WhereParser() extends JavaTokenParsers {

val in = "in|IN".r

val contains = "contains|CONTAINS".r
val notIn = "not in|NOT IN".r

val contains = "contains|CONTAINS".r

def where: Parser[Where] = rep(clause) ^^ (Where(_))

def paren: Parser[Clause] = "(" ~> clause <~ ")"
Expand Down Expand Up @@ -221,10 +223,14 @@ case class WhereParser() extends JavaTokenParsers {
case f ~ minV ~ maxV => Between(f, minV, maxV)
}

val _in = identWithDot ~ in ~ ("(" ~> repsep(stringLiteral, ",") <~ ")") ^^ {
val _in = identWithDot ~ (notIn | in) ~ ("(" ~> repsep(stringLiteral, ",") <~ ")") ^^ {
case f ~ op ~ values =>
if (f.startsWith("_parent")) IN(f, values.toSet)
else InWithoutParent(f, values.toSet)
val inClause =
if (f.startsWith("_parent")) IN(f, values.toSet)
else InWithoutParent(f, values.toSet)

if (op.toLowerCase == "in") inClause
else Not(inClause)
}

val _contains = identWithDot ~ contains ~ stringLiteral ^^ {
Expand Down

0 comments on commit a7ed4e8

Please sign in to comment.