r64262 - in /branches/upstream/libdata-alias-perl/current: Alias.xs Changes META.yml README lib/Data/Alias.pm

ansgar at users.alioth.debian.org ansgar at users.alioth.debian.org
Tue Oct 26 08:15:44 UTC 2010


Author: ansgar
Date: Tue Oct 26 08:11:43 2010
New Revision: 64262

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=64262
Log:
[svn-upgrade] new version libdata-alias-perl (1.08)

Modified:
    branches/upstream/libdata-alias-perl/current/Alias.xs
    branches/upstream/libdata-alias-perl/current/Changes
    branches/upstream/libdata-alias-perl/current/META.yml
    branches/upstream/libdata-alias-perl/current/README
    branches/upstream/libdata-alias-perl/current/lib/Data/Alias.pm

Modified: branches/upstream/libdata-alias-perl/current/Alias.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-alias-perl/current/Alias.xs?rev=64262&op=diff
==============================================================================
--- branches/upstream/libdata-alias-perl/current/Alias.xs (original)
+++ branches/upstream/libdata-alias-perl/current/Alias.xs Tue Oct 26 08:11:43 2010
@@ -1,4 +1,6 @@
 /* Copyright (C) 2003, 2004, 2006, 2007  Matthijs van Duin <xmath at cpan.org>
+ *
+ * Copyright (C) 2010 Andrew Main (Zefram) <zefram at fysh.org>
  *
  * Parts from perl, which is Copyright (C) 1991-2006 Larry Wall and others
  *
@@ -85,13 +87,41 @@
 #define SvREFCNT_inc_simple_void_NN SvREFCNT_inc_simple_NN
 #endif
 
+#if (PERL_COMBI_VERSION >= 5009003)
+#define DA_FEATURE_MULTICALL 1
+#endif
+
 #if (PERL_COMBI_VERSION >= 5009002)
-#define DA_FEATURE_MULTICALL 1
 #define DA_FEATURE_RETOP 1
 #endif
 
 #define INT2SIZE(x) ((MEM_SIZE)(SSize_t)(x))
 #define DA_ARRAY_MAXIDX ((IV) (INT2SIZE(-1) / (2 * sizeof(SV *))) )
+
+#ifndef Nullsv
+#define Nullsv ((SV*)NULL)
+#endif
+
+#ifndef Nullop
+#define Nullop ((OP*)NULL)
+#endif
+
+#if (PERL_COMBI_VERSION >= 5011000) && !defined(SVt_RV)
+#define SVt_RV SVt_IV
+#endif
+
+#if (PERL_COMBI_VERSION >= 5006000) && (PERL_COMBI_VERSION < 5011000)
+#define case_OP_SETSTATE_ case OP_SETSTATE:
+#else
+#define case_OP_SETSTATE_
+#endif
+
+#if (PERL_COMBI_VERSION >= 5011002)
+static char const msg_no_symref[] =
+	"Can't use string (\"%.32s\") as %s ref while \"strict refs\" in use";
+#else
+#define msg_no_symref PL_no_symref
+#endif
 
 #if (PERL_COMBI_VERSION >= 5009005)
 #ifdef PERL_MAD
@@ -111,6 +141,9 @@
 #define PL_nexttoke		(PL_parser->nexttoke)
 #define PL_nexttype		(PL_parser->nexttype)
 #define PL_tokenbuf		(PL_parser->tokenbuf)
+#define PL_yylval		(PL_parser->yylval)
+#elif (PERL_COMBI_VERSION >= 5009001)
+#define PL_yylval		(*PL_yylvalp)
 #endif
 
 
@@ -687,7 +720,7 @@
 		if (!SvOK(sv))
 			break;
 		if (PL_op->op_private & HINT_STRICT_REFS)
-			DIE(aTHX_ PL_no_symref, SvPV_nolen(sv), tname);
+			DIE(aTHX_ msg_no_symref, SvPV_nolen(sv), tname);
 		sv = (SV *) gv_fetchpv(SvPV_nolen(sv), TRUE, type);
 	} while (0);
 	if (SvTYPE(sv) == SVt_PVGV)
@@ -744,7 +777,7 @@
 		if (!SvOK(sv))
 			DIE(aTHX_ PL_no_usym, "a symbol");
 		if (PL_op->op_private & HINT_STRICT_REFS)
-			DIE(aTHX_ PL_no_symref, SvPV_nolen(sv), "a symbol");
+			DIE(aTHX_ msg_no_symref, SvPV_nolen(sv), "a symbol");
 		sv = (SV *) gv_fetchpv(SvPV_nolen(sv), TRUE, SVt_PVGV);
 	}
 	if (SvTYPE(sv) == SVt_PVGV)
@@ -1447,7 +1480,7 @@
 		default:
 			--hits;
 			switch (optype) {
-			case OP_SETSTATE:
+			case_OP_SETSTATE_
 			case OP_NEXTSTATE:
 			case OP_DBSTATE:
 				PL_curcop = (COP *) op;
@@ -1586,7 +1619,7 @@
 				if (da_peep2(aTHX_ k))
 					return 1;
 			} else switch (o->op_type ? o->op_type : o->op_targ) {
-			case OP_SETSTATE:
+			case_OP_SETSTATE_
 			case OP_NEXTSTATE:
 			case OP_DBSTATE:
 				PL_curcop = (COP *) o;
@@ -1651,7 +1684,7 @@
 	dDA;
 	SV **sp;
 	OP *kid;
-	char *s;
+	char *s, *start_s;
 	CV *cv;
 	o = da_old_ck_rv2cv(aTHX_ o);
 	kid = cUNOPo->op_first;
@@ -1663,32 +1696,49 @@
 	if (PL_lex_state != LEX_NORMAL && PL_lex_state != LEX_INTERPNORMAL)
 		return o; /* not lexing? */
 	SvPOK_off(cv);
-	s = PL_oldbufptr;
-	while (s < PL_bufend && isSPACE(*s)) s++;
-	if (memEQ(s, PL_tokenbuf, strlen(PL_tokenbuf))) {
-		s += strlen(PL_tokenbuf);
-		if (PL_bufptr > s) s = PL_bufptr;
-		while (s < PL_bufend && isSPACE(*s)) s++;
-	} else {
-		s = "";
-	}
-	op_null(o);
 	o->op_ppaddr = da_tag_rv2cv;
 	if (cv == da_cv)
 		o->op_flags &= ~OPf_SPECIAL;
 	else
 		o->op_flags |= OPf_SPECIAL;
+	start_s = s = PL_oldbufptr;
+	while (s < PL_bufend && isSPACE(*s)) s++;
+	if (memEQ(s, PL_tokenbuf, strlen(PL_tokenbuf))) {
+		s += strlen(PL_tokenbuf);
+		if (PL_bufptr > s) s = PL_bufptr;
+#if (PERL_COMBI_VERSION >= 5011002)
+		{
+			char *old_buf = SvPVX(PL_linestr);
+			char *old_bufptr = PL_bufptr;
+			PL_bufptr = s;
+			lex_read_space(LEX_KEEP_PREVIOUS);
+			if (SvPVX(PL_linestr) != old_buf)
+				Perl_croak(aTHX_ "Data::Alias can't handle "
+					"lexer buffer reallocation");
+			s = PL_bufptr;
+			PL_bufptr = old_bufptr;
+		}
+#else
+		while (s < PL_bufend && isSPACE(*s)) s++;
+#endif
+	} else {
+		s = "";
+	}
 	if (*s == '{') { /* here comes deep magic */
 		I32 shift;
+		YYSTYPE yylval = PL_yylval;
 		PL_bufptr = s;
 		PL_expect = XSTATE;
 		if ((PL_nexttype[PL_nexttoke++] = yylex()) == '{') {
 			PL_nexttype[PL_nexttoke++] = DO;
 			sv_setpv((SV *) cv, "$");
 		}
-		PL_lex_defer = PL_lex_state;
-		PL_lex_expect = PL_expect;
-		PL_lex_state = LEX_KNOWNEXT;
+		if(PL_lex_state != LEX_KNOWNEXT) {
+			PL_lex_defer = PL_lex_state;
+			PL_lex_expect = PL_expect;
+			PL_lex_state = LEX_KNOWNEXT;
+		}
+		PL_yylval = yylval;
 		if ((shift = s - PL_bufptr)) { /* here comes deeper magic */
 			s = SvPVX(PL_linestr);
 			PL_bufptr += shift;
@@ -1712,6 +1762,8 @@
 				SvCUR(PL_linestr) += shift;
 			}
 			*(PL_bufend = s + SvCUR(PL_linestr)) = '\0';
+			if (start_s < PL_bufptr)
+				memset(start_s, ' ', PL_bufptr-start_s);
 		}
 	}
 	if (!da_peeps++) {

Modified: branches/upstream/libdata-alias-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-alias-perl/current/Changes?rev=64262&op=diff
==============================================================================
--- branches/upstream/libdata-alias-perl/current/Changes (original)
+++ branches/upstream/libdata-alias-perl/current/Changes Tue Oct 26 08:11:43 2010
@@ -1,4 +1,9 @@
 Revision history for Perl extension Data::Alias
+
+1.08  Fri Oct 22 09:39 BST 2010
+	- Updated to work with Perl versions 5.11.0 up to 5.13.0,
+	  including particularly the major change in when rv2cv ops get
+	  built in 5.11.2
 
 1.07  Mon Sep 10 22:25 CEST 2007
 	- Fixed reference miscounting for 'my VAR' inside alias

Modified: branches/upstream/libdata-alias-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-alias-perl/current/META.yml?rev=64262&op=diff
==============================================================================
--- branches/upstream/libdata-alias-perl/current/META.yml (original)
+++ branches/upstream/libdata-alias-perl/current/META.yml Tue Oct 26 08:11:43 2010
@@ -1,6 +1,8 @@
 --- 
 abstract: Comprehensive set of aliasing operations
-author: Matthijs van Duin <xmath at cpan.org>
+author:
+  - 'Matthijs van Duin <xmath at cpan.org>'
+  - 'Andrew Main (Zefram) <zefram at fysh.org>'
 distribution_type: module
 generated_by: Module::Install version 0.67
 license: perl
@@ -14,4 +16,4 @@
     - t
 requires: 
   perl: 5.8.1
-version: 1.07
+version: 1.08

Modified: branches/upstream/libdata-alias-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-alias-perl/current/README?rev=64262&op=diff
==============================================================================
--- branches/upstream/libdata-alias-perl/current/README (original)
+++ branches/upstream/libdata-alias-perl/current/README Tue Oct 26 08:11:43 2010
@@ -1,4 +1,4 @@
-Data::Alias 1.07 - Comprehensive set of aliasing operations
+Data::Alias 1.08 - Comprehensive set of aliasing operations
 
 
 System requirements:
@@ -341,9 +341,12 @@
     members of the Amsterdam Perl Mongers, for their valuable feedback.
 
 AUTHOR
-    Matthijs van Duin <xmath at cpan.org>
+    Matthijs van Duin <xmath at cpan.org> developed the module originally,
+    and maintained it until 2007. Andrew Main (Zefram) <zefram at fysh.org>
+    updated it to work with Perl versions 5.11.0 and later.
 
 LICENSE
-    Copyright (C) 2003-2007 Matthijs van Duin. All rights reserved.
-    This program is free software; you can redistribute it and/or modify it
-    under the same terms as Perl itself.
+    Copyright (C) 2003-2007 Matthijs van Duin. Copyright (C) 2010 Andrew
+    Main (Zefram) <zefram at fysh.org>. All rights reserved.  This program
+    is free software; you can redistribute it and/or modify it under
+    the same terms as Perl itself.

Modified: branches/upstream/libdata-alias-perl/current/lib/Data/Alias.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-alias-perl/current/lib/Data/Alias.pm?rev=64262&op=diff
==============================================================================
--- branches/upstream/libdata-alias-perl/current/lib/Data/Alias.pm (original)
+++ branches/upstream/libdata-alias-perl/current/lib/Data/Alias.pm Tue Oct 26 08:11:43 2010
@@ -5,7 +5,7 @@
 use strict;
 use warnings;
 
-our $VERSION = '1.07';
+our $VERSION = '1.08';
 
 use base 'Exporter';
 use base 'DynaLoader';
@@ -367,11 +367,15 @@
 
 =head1 AUTHOR
 
-Matthijs van Duin <xmath at cpan.org>
+Matthijs van Duin <xmath at cpan.org> developed the module originally,
+and maintained it until 2007.  Andrew Main (Zefram) <zefram at fysh.org>
+updated it to work with Perl versions 5.11.0 and later.
 
 =head1 LICENSE
 
-Copyright (C) 2003-2007  Matthijs van Duin.  All rights reserved.
+Copyright (C) 2003-2007  Matthijs van Duin.
+Copyright (C) 2010 Andrew Main (Zefram) <zefram at fysh.org>.
+All rights reserved.
 This program is free software; you can redistribute it and/or modify 
 it under the same terms as Perl itself.
 




More information about the Pkg-perl-cvs-commits mailing list