diff options
Diffstat (limited to 'src/analysis/scan/exprs/handler.c')
-rw-r--r-- | src/analysis/scan/exprs/handler.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/analysis/scan/exprs/handler.c b/src/analysis/scan/exprs/handler.c index a14140a..1676522 100644 --- a/src/analysis/scan/exprs/handler.c +++ b/src/analysis/scan/exprs/handler.c @@ -54,10 +54,10 @@ static void g_scan_pattern_handler_finalize(GScanPatternHandler *); /* Réduit une expression à une forme plus simple. */ -static ScanReductionState g_scan_pattern_handler_reduce(GScanPatternHandler *, GScanContext *, GScanScope *, GScanExpression **); +static ScanReductionState g_scan_pattern_handler_reduce(const GScanPatternHandler *, GScanContext *, GScanScope *, GScanExpression **); /* Réduit une expression à une forme booléenne. */ -static bool g_scan_pattern_handler_reduce_to_boolean(GScanPatternHandler *, GScanContext *, GScanScope *, GScanExpression **); +static bool g_scan_pattern_handler_reduce_to_boolean(const GScanPatternHandler *, GScanContext *, GScanScope *, GScanExpression **); /* Dénombre les éléments portés par une expression. */ static bool g_scan_pattern_handler_count_items(const GScanPatternHandler *, GScanContext *, size_t *); @@ -213,13 +213,16 @@ bool g_scan_pattern_handler_create(GScanPatternHandler *handler, GSearchPattern { bool result; /* Bilan à retourner */ - result = true; + result = g_scan_expression_create(G_SCAN_EXPRESSION(handler), SRS_WAIT_FOR_SCAN); + if (!result) goto exit; handler->pattern = pattern; g_object_ref(G_OBJECT(pattern)); handler->type = type; + exit: + return result; } @@ -246,7 +249,7 @@ bool g_scan_pattern_handler_create(GScanPatternHandler *handler, GSearchPattern * * ******************************************************************************/ -static ScanReductionState g_scan_pattern_handler_reduce(GScanPatternHandler *expr, GScanContext *ctx, GScanScope *scope, GScanExpression **out) +static ScanReductionState g_scan_pattern_handler_reduce(const GScanPatternHandler *expr, GScanContext *ctx, GScanScope *scope, GScanExpression **out) { ScanReductionState result; /* Etat synthétisé à retourner */ @@ -276,7 +279,7 @@ static ScanReductionState g_scan_pattern_handler_reduce(GScanPatternHandler *exp * * ******************************************************************************/ -static bool g_scan_pattern_handler_reduce_to_boolean(GScanPatternHandler *expr, GScanContext *ctx, GScanScope *scope, GScanExpression **out) +static bool g_scan_pattern_handler_reduce_to_boolean(const GScanPatternHandler *expr, GScanContext *ctx, GScanScope *scope, GScanExpression **out) { bool result; /* Bilan à retourner */ size_t count; /* Quantité de correspondances */ |