X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=src%2Fmodule.c;h=1db2adff529377b922a848f262fbf71e6a680449;hp=b253e0a68d1b632d129b6f95d2969a52d95bc77b;hb=1b6db76e3005344b33ab45b00e7e61386a33932a;hpb=7df12c88a4e14611a2585d6e7c994c59e8d7485a diff --git a/src/module.c b/src/module.c index b253e0a..1db2adf 100644 --- a/src/module.c +++ b/src/module.c @@ -143,14 +143,7 @@ static PHP_FUNCTION(psi_validate) RETURN_FALSE; } - while (0 < psi_parser_scan(&P)) { - psi_parser_parse(&P, psi_token_alloc(&P)); - if (P.num == PSI_T_EOF) { - break; - } - } - psi_parser_parse(&P, NULL); - + psi_parser_parse(&P); psi_data_ctor(&D, P.error, P.flags); RETVAL_BOOL(psi_data_validate(&D, PSI_DATA(&P)) && !P.errors); psi_data_dtor(&D); @@ -180,14 +173,7 @@ static PHP_FUNCTION(psi_validate_string) RETURN_FALSE; } - while (0 < psi_parser_scan(&P)) { - psi_parser_parse(&P, psi_token_alloc(&P)); - if (P.num == PSI_T_EOF) { - break; - } - } - psi_parser_parse(&P, NULL); - + psi_parser_parse(&P); psi_data_ctor(&D, P.error, P.flags); RETVAL_BOOL(psi_data_validate(&D, PSI_DATA(&P)) && !P.errors); psi_data_dtor(&D);