in reply to
Re^3: Generate the perl sequence 1, 11, 111, ....
in thread Generate the perl sequence 1, 11, 111, ....
Use the source, Luke.
regex prefix_circumfix_meta_operator:reduce (--> List_prefix) {
$<s> = (
'['
[
| <op=infix> ']' ['«'|<?>]
| <op=infix_prefix_meta_operator> ']' ['«'|<?>]
| <op=infix_circumfix_meta_operator> ']' ['«'|<?>]
| \\<op=infix> ']' ['«'|<?>]
| \\<op=infix_prefix_meta_operator> ']' ['«'|<?>]
| \\<op=infix_circumfix_meta_operator> ']' ['«'|<?>]
]
) <?before \s | '(' >
...
So [\ is really a handled specially.
Or if you're not inclined to read the source, you can examine the match tree:
$ cat test.t
[\~] 1..3
$ perl5.10.0 STD5_dump_match test.t
comp_unit:
statementlist:
statement:
EXPR:
left:
pre:
prefix_circumfix_meta_operator:
[\
op:
~
]
noun:
value:
number:
integer:
1
infix:
..
right:
noun:
value:
number:
integer:
3
\n
The output in a terminal is coloured, and much better readable. Basically you see that
[\ is matched as a
prefix_circumfix_meta_operator with the
op: ~