Nested Quasis

Mark S. Miller erights at google.com
Tue Feb 7 14:51:56 PST 2012


On Tue, Feb 7, 2012 at 1:52 PM, Waldemar Horwat <waldemar at google.com> wrote:
[...]

> That's going back to the previous approach of treating the whole quasi as
> a single token.  This doesn't work because it's not possible to specify the
> BalancedCurlySequence production as a lexical grammar.  You're confusing
> the lexical with the syntactic grammars here.
>

Hi Waldemar, I am first of all trying to make clear what we're actually
proposing, and to resolve any genuine ambiguity. As for how we phrase this
proposal so that it fits with the rest of our spec language, what do you
suggest?



>
> Examples of why BalancedCurlySequence doesn't work:
>
> {/[{]/}
> (interior parses as five single-character tokens but no matching closing
> bracket)
>

Yes, and therefore a program consisting of

    `{/[{]/}`

fails to lex and fails to parse. That seems like the correct outcome.


> {ainb}
> (interior parses as three tokens: a in b)
>

Why doesn't it parse as one token: ainb ?


>
> {3.toString()}
> (interior parses as 3 . toString ( ))


Why? That's not what the JS lexer does anywhere else?

I don't at all see how you arrived at your conclusions. Is it actually
unclear what I am trying to say, or are you simply taking issue with how
I'm saying it? If you find Erik's way of specifying ok, let's just use
that. As I just said in reply to him, it does capture my actual intent more
directly.

-- 
    Cheers,
    --MarkM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120207/ae767bc3/attachment-0001.html>


More information about the es-discuss mailing list