X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Fparser_proc_grammar.y;h=c076abd0e5a630f1db8c78e2fd5fd5d10a144a8c;hb=d4bd55e7d9b1cf63cd6fdc96b70010a0c2aca963;hp=6dbac472f7da04413a97cf79265e287d745572d1;hpb=a7ac1c0a3c855321f21682c127a4b707de33a303;p=m6w6%2Fext-psi diff --git a/src/parser_proc_grammar.y b/src/parser_proc_grammar.y index 6dbac47..c076abd 100644 --- a/src/parser_proc_grammar.y +++ b/src/parser_proc_grammar.y @@ -2321,7 +2321,16 @@ static void psi_parser_proc_error(struct psi_parser *P, struct psi_plist *tokens psi_plist_get(tokens, last, &T); if (T) { + int i = (last >= 5) ? last - 5 : 0; + P->error(PSI_DATA(P), T, PSI_WARNING, "PSI %s at col %u", msg, T->col); + while (i <= last || T->type != PSI_T_EOS) { + if (!psi_plist_get(tokens, i++, &T)) { + break; + } + P->error(PSI_DATA(P), T, PSI_WARNING, "PSI %s token '%s' at col %u", + ilast+1?"following":"offending", T->text->val, T->col); + } } else { P->error(PSI_DATA(P), NULL, PSI_WARNING, "PSI %s", msg); }