> Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
> Date: Mon, 9 Dec 2002 23:43:44 +0000
> Cc: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> Content-Disposition: inline
> From: Nicholas Clark <[EMAIL PROTECTED]>
> X-SMTPD: qpsmtpd/0.20, http://develooper.com/code/qpsmtpd/
> 
> On Sun, Dec 08, 2002 at 03:41:22PM +1100, Damian Conway wrote:
> > Nicholas Clark wrote:
> 
> > >Well, I was wondering if my function returned "CR", then
> > >"\c[$(call_a_func())]" would mean that the "CR" gets run thought the
> > >\c[...] conversion and a single byte ("\r") is what ends up in the string.
> > 
> > I seriously doubt it. %-)
> 
> So what will perl6's "" parser do if it is presented with what appears to
> be a $() interpolation sequence inside some other double quoting
> construction?
> 
> 1: Proceed silently (so treating "\c[$(call_a_func())]" as a request for
>    the character literally named '$(call_a_func())'), potentially returning
>    whatever warnings fall out of that second stage
> 2: Issue a nesting warning when it finds something that seems to be an
>    interpolative construction occurring within another construction, but
>    otherwise carry on
> 3: Treat it as a syntax error
> 
> I suspect that the answer is "yes" - ie all of the above, with a warning on
> nesting interpolative constructions, which can be made fatal, and can be made
> silent.

You must remember that the Perl 6 parser is one-pass now.  An
interpolating string has a rule set of its own, whose simplified
version might look like this:

    grammar interpolating_string {

        rule string { " <string_thing>* " }

        rule string_thing { \$\( <Perl::expression> \)
                          | \\c \[ .*? \] 
                          | <character> }
        
        rule character { \\ \\ | \\ " | . }
    }

So I imagine that it would do your no. 1, as it's not looking for an
interpolating construct.

Luke

Reply via email to