Re: On pragmas…

"C. M. Sperberg-McQueen" <cmsmcq@blackmesatech.com> writes:
[…]
> For the use cases we have been able to imagine for pragmas, using the
> existing locations of s as the possible locations for pragmas would be
> very inconvenient: many of the locations that look as if they are where
> you would want a pragma that applies to a particular token will place
> the pragma somewhere else, not as a child of that token in the XML.  See
> mail from Norm on this topic sometime in the last couple of weeks.

Yes. I made a proposal along these the same lines as Liam and Michael
easily persuaded me that the small additional effort required to put
pragmas at useful places in the grammar, so that the scope of their
effect was clearly and unambiguously identified, was the right thing to
do.

> correctly, Norm has an idea that could make it work (it involves
> wrapping each top-level alt that wants a pragma in parentheses, which
> produces an alt/alts/alt nesting in the XML; that may be a price worth
> paying).

I haven’t (yet) pursued that further. My “use case” was that I was
writing a test. So it didn’t *actually* matter that I couldn’t apply a
pragma where I was trying to, I just learned something about the
grammar. But I don’t think it’s implausible to want to apply a pragma to
set of alternatives, even if I don’t have such a pragma at hand, so I
agree with Michael that making it possible, even if at a slight
grammatical cost, might be worth doing.

                                        Be seeing you,
                                          norm

--
Norm Tovey-Walsh
Saxonica

Received on Wednesday, 30 March 2022 07:43:08 UTC