Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl.git] branch blead, updated. v5.11.2-82-g17c59fd

0 views
Skip to first unread message

Vincent Pit

unread,
Nov 28, 2009, 7:28:09 AM11/28/09
to perl5-...@perl.org
In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/17c59fdf7540adaf656e96fe6d48b58dab391dc0?hp=162177c1aed1991639f7f0da64e918c034e1148a>

- Log -----------------------------------------------------------------
commit 17c59fdf7540adaf656e96fe6d48b58dab391dc0
Author: Vincent Pit <vi...@profvince.com>
Date: Sat Nov 28 13:27:02 2009 +0100

Allow a closing brace after an "use VERSION"

This fixes [perl #70884] : use VERSION in BLOCK without semicolon -> syntax error
-----------------------------------------------------------------------

Summary of changes:
t/comp/use.t | 14 +++++++++++++-
toke.c | 3 ++-
2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/t/comp/use.t b/t/comp/use.t
index fade9fe..c9b76d7 100755
--- a/t/comp/use.t
+++ b/t/comp/use.t
@@ -6,7 +6,7 @@ BEGIN {
$INC{"feature.pm"} = 1; # so we don't attempt to load feature.pm
}

-print "1..69\n";
+print "1..73\n";

# Can't require test.pl, as we're testing the use/require mechanism here.

@@ -62,6 +62,18 @@ sub isnt ($$;$) {
_ok ('isnt', @_);
}

+eval "use 5"; # implicit semicolon
+is ($@, '');
+
+eval "use 5;";
+is ($@, '');
+
+eval "{use 5}"; # [perl #70884]
+is ($@, '');
+
+eval "{use 5 }"; # [perl #70884]
+is ($@, '');
+
# new style version numbers

eval q{ use v5.5.630; };
diff --git a/toke.c b/toke.c
index 173ded4..dfcb034 100644
--- a/toke.c
+++ b/toke.c
@@ -3807,7 +3807,8 @@ S_tokenize_use(pTHX_ int is_use, char *s) {
s = SKIPSPACE1(s);
if (isDIGIT(*s) || (*s == 'v' && isDIGIT(s[1]))) {
s = force_version(s, TRUE);
- if (*s == ';' || (s = SKIPSPACE1(s), *s == ';')) {
+ if (*s == ';' || *s == '}'
+ || (s = SKIPSPACE1(s), (*s == ';' || *s == '}'))) {
start_force(PL_curforce);
NEXTVAL_NEXTTOKE.opval = NULL;
force_next(WORD);

--
Perl5 Master Repository

0 new messages