On Sun, Aug 12, 2012 at 12:43 PM, Alexander Polakov <p...@sdf.org> wrote:
> Ok, second attempt

Nice.  One fix;


> @@ -342,7 +346,10 @@
>                                                 PUSH_STATE(STBRACE);
>                                         } else {
>                                                 ungetsc(c);
> -                                               PUSH_STATE(SBRACE);
> +                                               if (state == SDQUOTE)
> +                                                       PUSH_STATE(SBRACEQ);
> +                                               else
> +                                                       PUSH_STATE(SBRACE);

That should be
   if (state == SDQUOTE ||
       state == SBRACEQ)
...

so that doubly nested forms like
    foo=1; echo "${foo:+${foo:+'blah  $foo'}}"
give
    'blah  1'

...and yes, I now have a still bigger diff to unclass2.t that includes
that test. :-)


I think the lex.h diff is nicer if the new SBRACEQ state is stuck at
the end of the existing list instead of renumbering additional states,
but I can be argued into renumbering them...


Philip Guenther

Reply via email to