diff options
author | Florian Westphal <fw@strlen.de> | 2019-02-08 17:02:22 +0100 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2019-02-08 21:22:51 +0100 |
commit | 72931553828af0ce85f0562b9ff8ec7f4d28e050 (patch) | |
tree | 6fe42e2a99febc3ff783f63b8219de81215cf0d3 /src/parser_json.c | |
parent | 2cc91e6198e7ee8b9d0f8727c67a849fec393cd0 (diff) |
src: expr: add expression etype
Temporary kludge to remove all the expr->ops->type == ... patterns.
Followup patch will remove expr->ops, and make expr_ops() lookup
the correct expr_ops struct instead to reduce struct expr size.
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'src/parser_json.c')
-rw-r--r-- | src/parser_json.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/parser_json.c b/src/parser_json.c index 6268ad5b..3a9a3798 100644 --- a/src/parser_json.c +++ b/src/parser_json.c @@ -993,7 +993,7 @@ static struct expr *json_parse_concat_expr(struct json_ctx *ctx, expr = tmp; continue; } - if (expr->ops->type != EXPR_CONCAT) { + if (expr->etype != EXPR_CONCAT) { struct expr *concat; concat = concat_expr_alloc(int_loc); @@ -1093,7 +1093,7 @@ static struct expr *json_parse_set_expr(struct json_ctx *ctx, if (!expr) return NULL; - if (expr->ops->type == EXPR_SYMBOL && + if (expr->etype == EXPR_SYMBOL && expr->symtype == SYMBOL_SET) return expr; @@ -1116,7 +1116,7 @@ static struct expr *json_parse_set_expr(struct json_ctx *ctx, expr_free(set_expr); return NULL; } - if (expr->ops->type != EXPR_SET_ELEM) + if (expr->etype != EXPR_SET_ELEM) expr = set_elem_expr_alloc(int_loc, expr); expr2 = json_parse_set_rhs_expr(ctx, jright); @@ -1137,7 +1137,7 @@ static struct expr *json_parse_set_expr(struct json_ctx *ctx, return NULL; } - if (expr->ops->type != EXPR_SET_ELEM) + if (expr->etype != EXPR_SET_ELEM) expr = set_elem_expr_alloc(int_loc, expr); } @@ -1406,7 +1406,7 @@ static struct expr *json_parse_set_elem_expr_stmt(struct json_ctx *ctx, json_t * { struct expr *expr = json_parse_flagged_expr(ctx, CTX_F_SES, root); - if (expr && expr->ops->type != EXPR_SET_ELEM) + if (expr && expr->etype != EXPR_SET_ELEM) expr = set_elem_expr_alloc(int_loc, expr); return expr; @@ -1559,7 +1559,7 @@ static struct stmt *json_parse_mangle_stmt(struct json_ctx *ctx, return NULL; } - switch (key->ops->type) { + switch (key->etype) { case EXPR_EXTHDR: return exthdr_stmt_alloc(int_loc, key, value); case EXPR_PAYLOAD: |