Nested Quasis
Waldemar Horwat
waldemar at google.com
Thu Feb 2 18:27:45 PST 2012
On 02/02/2012 04:15 PM, Mark S. Miller wrote:
>
>
> On Thu, Feb 2, 2012 at 2:00 PM, Waldemar Horwat <waldemar at google.com <mailto:waldemar at google.com>> 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.id <http://id.id>, $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 `...$id.id...` and `...$id[expr]...`, only the first id in each case in in the quasiHole. All the text afterwards is part of the QuasiClose.
Good. I'll have to think about this a bit more, but there's a chance you converted me.
Waldemar
More information about the es-discuss
mailing list