Moritz Lenz wrote:
> I noticed that in larger grammars (like STD.pm and many PGE grammars in
> the parrot repo) string literals are always quoted for clarity
>
> regex foo {
> 'literal' <subregex>
> }
>
> Since I think this is a good idea, we could just as well enforce that, and
> drop the <...> around method/regex calls:
>
> regex foo {
> 'literal' subregex
> }
>
> This way we'll approximate "normal" Perl 6 syntax, and maybe even improve
> huffman coding.
>
> I guess such a syntax wouldn't be acceptible in short regexes, which are
> typically written as m/.../, rx/.../ or s[...][..], so we could preseve
> the old syntax for these regexes.
Nitpick: s[...][..] isn't valid syntax anymore; the correct P6
equivalent is s[...] = qq[..], for reasons that were hashed out on
this list some time ago. However, s/.../../ is still valid.
I'm not in favor of the so-called "short forms" having a different
syntax from the "long forms", and I personally like the current syntax
for both. That said, all's fair if you predeclare: I could see
someone creating a module that allows you to tweak the regex syntax in
a manner similar to what you're proposing, if there's enough of a
demand for it.
--
Jonathan "Dataweaver" Lang