In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/52d0e95bfa64548328a8cb945b92a6ff4892a5ad?hp=635c61269cc04179494de99f235b95556c05902d>

- Log -----------------------------------------------------------------
commit 52d0e95bfa64548328a8cb945b92a6ff4892a5ad
Author: Father Chrysostomos <[email protected]>
Date:   Fri Aug 3 18:35:26 2012 -0700

    [perl #114222] Make ‘use’ parse arguments in term context
    
    (lexing context, that is)
    
    use constant { () }
    
    was a syntax error, because the lexer was guessing when { should be
    a statement or hash.
    
    It should not be doing that where a term is expected.
    
    It was actually getting itself confused, and trying to parse the
    argument list as a statement.
    
    Setting PL_expect after force_next is ineffectual, as force_next
    records the current value of PL_expect, arranging to have it
    restored.
    
    OPERATOR(USE) was setting PL_expect, but too late.  So no we set
    PL_expect explicitly in S_tokenize_use, before any forced tokens,
    and use TOKEN(USE), which does not set PL_expect (as setting it
    there has no effect).

M       t/comp/use.t
M       toke.c

commit cf26f5d571f7d70d3c224acf75da4164e6a353c2
Author: Reini Urban <[email protected]>
Date:   Sun Jul 15 12:15:45 2012 -0500

    perlexperiment.pod clarifications
    
    Removed in Perl is misleading. Those modules just moved to CPAN and are not 
deprecated.
    threads are now ithreads since multiplicity.

M       pod/perlexperiment.pod
-----------------------------------------------------------------------

Summary of changes:
 pod/perlexperiment.pod |    6 +++---
 t/comp/use.t           |    5 ++++-
 toke.c                 |    3 ++-
 3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/pod/perlexperiment.pod b/pod/perlexperiment.pod
index f304120..1538452 100644
--- a/pod/perlexperiment.pod
+++ b/pod/perlexperiment.pod
@@ -50,7 +50,7 @@ Introduced in Perl 5.6.0
 
 Accepted in Perl 5.8.0 XXX
 
-=item -Dusemultiplicity -Dusethreads
+=item -Dusemultiplicity -Duseithreads
 
 Introduced in Perl 5.6.0
 
@@ -72,13 +72,13 @@ Removed in Perl 5.10 XXX
 
 =item Test::Harness::Straps
 
-Removed in Perl 5.10.1
+Moved from Perl 5.10.1 to CPAN
 
 =item perlcc
 
 Introduced in Perl 5.005
 
-Removed in Perl 5.9.0
+Moved from Perl 5.9.0 to CPAN
 
 =item C<our> can now have an experimental optional attribute C<unique>
 
diff --git a/t/comp/use.t b/t/comp/use.t
index 25e2a96..12409cf 100644
--- 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..83\n";
+print "1..84\n";
 
 # Can't require test.pl, as we're testing the use/require mechanism here.
 
@@ -167,6 +167,9 @@ ok $@, 'no strict vars allows ver decl to enable subs';
 
 { use test_use }       # check that subparse saves pending tokens
 
+use test_use { () };
+is ref $test_use::got[0], 'HASH', 'use parses arguments in term lexing cx';
+
 local $test_use::VERSION = 1.0;
 
 eval "use test_use 0.9";
diff --git a/toke.c b/toke.c
index c65aecf..9deac94 100644
--- a/toke.c
+++ b/toke.c
@@ -4318,6 +4318,7 @@ S_tokenize_use(pTHX_ int is_use, char *s) {
     if (PL_expect != XSTATE)
        yyerror(Perl_form(aTHX_ "\"%s\" not allowed in expression",
                    is_use ? "use" : "no"));
+    PL_expect = XTERM;
     s = SKIPSPACE1(s);
     if (isDIGIT(*s) || (*s == 'v' && isDIGIT(s[1]))) {
        s = force_version(s, TRUE);
@@ -7751,7 +7752,7 @@ Perl_yylex(pTHX)
 
        case KEY_no:
            s = tokenize_use(0, s);
-           OPERATOR(USE);
+           TERM(USE);
 
        case KEY_not:
            if (*s == '(' || (s = SKIPSPACE1(s), *s == '('))

--
Perl5 Master Repository

Reply via email to