Skip to content

Commit

Permalink
Add compile-time error for unsupported AST node types (RedisGraph#944)
Browse files Browse the repository at this point in the history
Co-authored-by: Roi Lipman <swilly22@users.noreply.github.com>
  • Loading branch information
jeffreylovitz and swilly22 committed Feb 23, 2020
1 parent f31a74c commit 4db0526
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/ast/ast_build_ar_exp.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,8 +441,11 @@ static AR_ExpNode *_AR_EXP_FromExpression(const cypher_astnode_t *expr) {
CYPHER_AST_PATTERN_COMPREHENSION
CYPHER_AST_REDUCE
*/
printf("Encountered unhandled type '%s'\n", cypher_astnode_typestr(type));
assert(false);
const char *type_str = cypher_astnode_typestr(type);
char *error;
asprintf(&error, "RedisGraph does not currently support the type '%s'", type_str);
QueryCtx_SetError(error);
return AR_EXP_NewConstOperandNode(SI_NullVal());
}

assert(false);
Expand Down

0 comments on commit 4db0526

Please sign in to comment.