develooper Front page | perl.perl5.porters | Postings from August 2013

Re: Perl 5.18 and Regexp::Grammars

Thread Previous | Thread Next
From:
Aristotle Pagaltzis
Date:
August 11, 2013 18:22
Subject:
Re: Perl 5.18 and Regexp::Grammars
Message ID:
20130811182206.GA6375@fernweh.plasmasturm.org
* Damian Conway <damian@conway.org> [2013-08-11 01:20]:
> And, ideally, the source code fragment being passed into the
> overloading sub would not just be the "contents" of each constant
> construct, but the entire syntax of the construct, including:
>
>     - the delimiters used
>
>     - any keyword used ('q', 'qq', 'qr', 'qx', 's', 'tr', or 'y')
>
>     - any flags used (i.e. in the case of 's', 'tr', and 'y')
>
>
> That is, reworking and extending your own example […] would output:
>
>     source(qr/abc(?{})def$x/i)
>     source("ABC$a[$b+$c]DEF")
>     source(s{foo}{bar}gxms)
>     source(0xDeadCode)

Wouldn’t it be better if these paraphernalia were passed in as separate
arguments so that the Perl code won’t have to implement its own parsing
on top of perl’s?

-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About