X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=src%2Fcontext.c;h=cbcfbc6b1d6ecd6e32ab0a2a099cf557cad958f1;hp=05d5aacbfc3d1d041957d88b72df257ee35e47f5;hb=14c98cac21b8102d1d4c2a57744f6976ea3a0849;hpb=ea0162a1698563a49de50456cd3f2cc18b83a05e;ds=sidebyside diff --git a/src/context.c b/src/context.c index 05d5aac..cbcfbc6 100644 --- a/src/context.c +++ b/src/context.c @@ -960,9 +960,13 @@ void PSI_ContextBuild(PSI_Context *C, const char *paths) continue; } - while (-1 != PSI_ParserScan(&P)) { + while (0 < PSI_ParserScan(&P)) { PSI_ParserParse(&P, PSI_TokenAlloc(&P)); - }; + if (P.num == PSI_T_EOF) { + break; + } + } + PSI_ParserParse(&P, NULL); PSI_ContextValidate(C, &P); PSI_ParserDtor(&P);