Skip to content

Commit

Permalink
Add support for comparing against null (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
AvitalTamir authored Nov 4, 2024
1 parent aebb8ff commit e7ce8b0
Show file tree
Hide file tree
Showing 6 changed files with 478 additions and 268 deletions.
7 changes: 4 additions & 3 deletions grammar/cyphernetes.y
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func debugLog(v ...interface{}) {
%token REL_NOPROPS_RIGHT REL_NOPROPS_LEFT REL_NOPROPS_BOTH REL_NOPROPS_NONE REL_BEGINPROPS_LEFT REL_BEGINPROPS_NONE REL_ENDPROPS_RIGHT REL_ENDPROPS_NONE
%token COUNT SUM NOT_EQUALS GREATER_THAN LESS_THAN GREATER_THAN_EQUALS LESS_THAN_EQUALS CONTAINS REGEX_COMPARE
%token IN
%token NULL

%type<expression> Expression
%type<matchClause> MatchClause
Expand Down Expand Up @@ -360,21 +361,21 @@ Value:
$$ = strings.Trim($1, "\"")
}
| INT {
// Parse the int from the string
i, err := strconv.Atoi($1)
if err != nil {
// ... handle error
panic(err)
}
$$ = i
}
| BOOLEAN {
// Parse the boolean from the string
$$ = strings.ToUpper($1) == "TRUE"
}
| JSONDATA {
$$ = $1
}
| NULL {
$$ = nil
}
;

Contexts:
Expand Down
Loading

0 comments on commit e7ce8b0

Please sign in to comment.