diff options
author | Yves Orton <demerphq@gmail.com> | 2020-02-06 08:40:57 +0100 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2020-02-10 04:18:34 +0100 |
commit | 60267e1d0e12bb5bdc88c62a18294336ab03d4b8 (patch) | |
tree | 61b68656bc8b6a9e51e286849856fb200a301add /t/comp | |
parent | f9d2c26d7d4dcb4bedbd57fa433fb75d9cc13926 (diff) | |
download | perl-60267e1d0e12bb5bdc88c62a18294336ab03d4b8.tar.gz |
toke.c - handle ${10} properly - Issue #12948
${10} and $10 were handled differently, this patch makes them be handled
the same. It also forbids multi-digit numeric variables from starting
with 0. Thus $00 is now a new fatal exception
"Numeric variables with more than one digit may not start with '0'"
Diffstat (limited to 't/comp')
-rw-r--r-- | t/comp/parser_run.t | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/t/comp/parser_run.t b/t/comp/parser_run.t index 79b669d807..f921aa1b87 100644 --- a/t/comp/parser_run.t +++ b/t/comp/parser_run.t @@ -10,12 +10,12 @@ BEGIN { set_up_inc( qw(. ../lib ) ); } -plan(5); +plan(6); # [perl #130814] can reallocate lineptr while looking ahead for # "Missing $ on loop variable" diagnostic. my $result = fresh_perl( - " foreach m0\n\$" . ("0" x 0x2000), + " foreach m0\n\$" . ("v" x 0x2000), { stderr => 1 }, ); is($result . "\n", <<EXPECT); @@ -24,6 +24,12 @@ syntax error at - line 3, near "foreach m0 Identifier too long at - line 3. EXPECT +fresh_perl_is(<<'EOS', <<'EXPECT', {}, "check zero vars"); +print $001; +EOS +Numeric variables with more than one digit may not start with '0' at - line 1. +EXPECT + fresh_perl_is(<<EOS, <<'EXPECT', {}, "linestart before bufptr"); \${ \xB6eeeeeeeeeeee 'x |