On Mon, 05 Jul 2021 16:30:49 +0959, Reuben ua =?UTF-8?Q?Br=C3=AD=C4=A1?= wrote:
> if i might suggest a slight variation, how about only requiring that
> at least one of the lists is non-empty, in the case of while, and
> leaving for, until, etc. as they are?
>
> this way nothing is broken.
>
> your diff might then look something like:
>
> t->left = c_list(true);
> t->right = dogroup();
> + if (t->left == NULL && t->right == NULL)
> + syntaxerr(NULL);
That would result in an error like:
ksh: syntax error: `done' unexpected
instead of:
ksh: syntax error: `do' unexpected
But perhaps this is not important. It is also possible to call
yyerror() directly to display the error.
- todd