summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
7237302)
This wires in custom expression handler functionality, which was present
in json script since the original version, but never used.
Signed-off-by: Denis Osvald <denis.osvald@sartura.hr>
Signed-off-by: Felix Fietkau <nbd@nbd.name> [error handling fix]
}
ret = __json_process_type(call, cur, expr, ARRAY_SIZE(expr), &found);
}
ret = __json_process_type(call, cur, expr, ARRAY_SIZE(expr), &found);
- if (!found)
- ctx->handle_error(ctx, "Unknown expression type", cur);
+ if (!found) {
+ const char *name = blobmsg_data(blobmsg_data(cur));
+ ctx->handle_expr(ctx, name, cur, call->vars);
+ }
__default_handle_expr(struct json_script_ctx *ctx, const char *name,
struct blob_attr *expr, struct blob_attr *vars)
{
__default_handle_expr(struct json_script_ctx *ctx, const char *name,
struct blob_attr *expr, struct blob_attr *vars)
{
+ ctx->handle_error(ctx, "Unknown expression type", expr);