On Wed, 7 Sept 2022 at 18:13, Yair Lenga <yair.le...@gmail.com> wrote:

> Thanks for providing feedback and expanding with new ideas.
>
> I believe the summary is:
>
> ${a.key1.key2} - Static fields
> ${a.key1.$key2} - Mixed dynamic/static,  simple substitution.
> ${a.key1.{complex.$key2}} - For complex keys that may contain anything
> ${a.key1[expr].key2] - expr is evaluated in numeric context
>
> Did I get it right ?
>

Yes, that's exactly what I had in mind.

I would initially limit the "simple" keys to strings that are valid
identifiers, or a single variable expansion without {}; we can see later
whether that can be relaxed.

That means that ${var.$key} and var.$key=value would be valid, but
${var.${key}} and var.${key}=value would not. The reason is to simplify the
lexer, which has to recognize assignments early in the parsing process, and
then to make expansions use the same form as assignments. Requiring the
'.{' pair when recursion *is* necessary makes it less likely to break
existing code.

Reply via email to