Nested Quasis

Mark S. Miller erights at
Thu Feb 2 16:15:48 PST 2012

On Thu, Feb 2, 2012 at 2:00 PM, Waldemar Horwat <waldemar at> wrote:

> OK.  This introduces yet another lexing context, in which all productions
> *except* QuasiMiddle and QuasiEnd are disallowed, and white space and
> comment handling is funny.  That works if the expressions must be one of
> the two forms:
> $id
> ${expr}
> Is that the exhaustive list, or are we looking at other forms such as $$, $
>, $id[expr], etc.?

I'll let Mike speak for the details of what he really wants to propose. But
here are the answers from E:

escapes with the quasi literal text are taken care of by the QuasiChar
production, much like the existing definition of DoubleStringCharacter:

    QuasiChar ::
        SourceCharacter but not one of $ or `
        $ $
        $ `
        $ \ EscapeSequence

So that `$$` === "$", `$`` === "`", and `$\n` === "\n", respectively.

Regarding `...$` and `...$id[expr]...`, only the first id in each
case in in the quasiHole. All the text afterwards is part of the QuasiClose.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list