build cleanup
[m6w6/ext-psi] / src / parser_proc_grammar.y
index 6dbac472f7da04413a97cf79265e287d745572d1..cd828e63861748e0a3710336c4e8e562d5f2b438 100644 (file)
@@ -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) {
+               size_t 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", 
+                                       i<last+1?"preceding":i>last+1?"following":"offending", T->text->val, T->col);
+               }
        } else {
                P->error(PSI_DATA(P), NULL, PSI_WARNING, "PSI %s", msg);
        }