X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=src%2Fmodule.c;fp=src%2Fmodule.c;h=1323a9f5b5f616d83ac752a2af17a368a708ebee;hp=20a1836140a0122c25ff83b726345e867f6dc2bc;hb=c9384515a81cb64d345b299908b2852f51bb8e6e;hpb=b029005e56a8913fbb3d17ab497b4a37a00a211c diff --git a/src/module.c b/src/module.c index 20a1836..1323a9f 100644 --- a/src/module.c +++ b/src/module.c @@ -133,6 +133,7 @@ static PHP_FUNCTION(psi_validate) struct psi_parser_input *I; struct psi_parser P; struct psi_data D = {0}; + struct psi_validate_scope S = {0}; zend_long flags = 0; #if PHP_DEBUG @@ -155,7 +156,10 @@ static PHP_FUNCTION(psi_validate) psi_parser_parse(&P, I); psi_data_ctor(&D, P.error, P.flags); - RETVAL_BOOL(psi_data_validate(&D, PSI_DATA(&P)) && !P.errors); + psi_validate_scope_ctor(&S); + S.defs = &P.preproc->defs; + RETVAL_BOOL(psi_validate(&S, &D, PSI_DATA(&P)) && !P.errors); + psi_validate_scope_dtor(&S); psi_data_dtor(&D); psi_parser_dtor(&P); free(I); @@ -170,6 +174,7 @@ static PHP_FUNCTION(psi_validate_string) struct psi_parser_input *I; struct psi_parser P; struct psi_data D = {0}; + struct psi_validate_scope S = {0}; zend_long flags = 0; #if PHP_DEBUG @@ -192,7 +197,10 @@ static PHP_FUNCTION(psi_validate_string) psi_parser_parse(&P, I); psi_data_ctor(&D, P.error, P.flags); - RETVAL_BOOL(psi_data_validate(&D, PSI_DATA(&P)) && !P.errors); + psi_validate_scope_ctor(&S); + S.defs = &P.preproc->defs; + RETVAL_BOOL(psi_validate(&S, &D, PSI_DATA(&P)) && !P.errors); + psi_validate_scope_dtor(&S); psi_data_dtor(&D); psi_parser_dtor(&P); free(I);