This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
toke.c: Under -DT, report pending idents more clearly
authorFather Chrysostomos <sprout@cpan.org>
Sat, 1 Jun 2013 01:27:19 +0000 (18:27 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sat, 1 Jun 2013 03:34:23 +0000 (20:34 -0700)
These are treated as forced tokens of type 'p'.  Indicate what the 'p'
means in the debug output.

This:

### 0:LEX_NORMAL/XSTATE "\n;"
### forced token:
### <== 'p'

becomes this:

### 0:LEX_NORMAL/XSTATE "\n;"
### forced token:
### <== 'p' (pending identifier)

toke.c

diff --git a/toke.c b/toke.c
index ba67bc6..954ec33 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -427,7 +427,11 @@ S_tokereport(pTHX_ I32 rv, const YYSTYPE* lvalp)
        if (name)
            Perl_sv_catpv(aTHX_ report, name);
        else if ((char)rv > ' ' && (char)rv <= '~')
+       {
            Perl_sv_catpvf(aTHX_ report, "'%c'", (char)rv);
+           if ((char)rv == 'p')
+               sv_catpvs(report, " (pending identifier)");
+       }
        else if (!rv)
            sv_catpvs(report, "EOF");
        else