X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=src%2Fmodule.c;h=1db2adff529377b922a848f262fbf71e6a680449;hp=b253e0a68d1b632d129b6f95d2969a52d95bc77b;hb=6509a2053456d0e63b6f383b757289d3016ed1a5;hpb=ef48feab1da9d7a419980294bcbf03ceefd81d1c 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);