summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Vincent <jesse@bestpractical.com>2010-02-03 09:43:08 -0800
committerJesse Vincent <jesse@bestpractical.com>2010-02-03 09:43:08 -0800
commit14a86d0ccd20f01e74c8b4605e1dc764acc06a35 (patch)
treef4016eaa6321e2bed468d10421597c7a2f16367b
parentea4c52f0a523df1f06490e701866bb9594395b00 (diff)
downloadperl-14a86d0ccd20f01e74c8b4605e1dc764acc06a35.tar.gz
Allow arbitrary whitespace between NAME and VERSION in "package NAME VERSION;" statements
Fixes [perl #72432]
-rw-r--r--perly.act3
-rw-r--r--perly.h42
-rw-r--r--perly.tab2
-rw-r--r--toke.c1
4 files changed, 26 insertions, 22 deletions
diff --git a/perly.act b/perly.act
index 73190765fb..6d20c29ed4 100644
--- a/perly.act
+++ b/perly.act
@@ -1627,8 +1627,5 @@ case 2:
{ (yyval.opval) = (ps[(1) - (1)].val.opval); ;}
break;
-
-/* Line 1267 of yacc.c. */
-
default: break;
diff --git a/perly.h b/perly.h
index 5d591fae9f..b40a968c10 100644
--- a/perly.h
+++ b/perly.h
@@ -1,25 +1,24 @@
#ifdef PERL_CORE
-/* A Bison parser, made by GNU Bison 2.3. */
-/* Skeleton interface for Bison's Yacc-like parsers in C
+/* A Bison parser, made by GNU Bison 2.4.1. */
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+/* Skeleton interface for Bison's Yacc-like parsers in C
+
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
+
+ This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA. */
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
@@ -30,10 +29,11 @@
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
-
+
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
+
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
@@ -113,6 +113,7 @@
PEG = 328
};
#endif
+
/* Tokens. */
#define WORD 258
#define METHOD 259
@@ -188,11 +189,13 @@
-
#endif /* PERL_CORE */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
{
+
+/* Line 1676 of yacc.c */
+
I32 ival; /* __DEFAULT__ (marker for regen_perly.pl;
must always be 1st union member) */
char *pval;
@@ -208,13 +211,16 @@ typedef union YYSTYPE
#ifdef PERL_MAD
TOKEN* tkval;
#endif
-}
-/* Line 1529 of yacc.c. */
- YYSTYPE;
+
+
+
+/* Line 1676 of yacc.c */
+} YYSTYPE;
+# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
-# define YYSTYPE_IS_TRIVIAL 1
#endif
+
diff --git a/perly.tab b/perly.tab
index d5d0169136..34096e145e 100644
--- a/perly.tab
+++ b/perly.tab
@@ -216,7 +216,7 @@ static const char *const yytname[] =
"mexpr", "mnexpr", "miexpr", "label", "decl", "peg", "format",
"formname", "mysubrout", "subrout", "startsub", "startanonsub",
"startformsub", "subname", "proto", "subattrlist", "myattrlist",
- "subbody", "package", "use", "@1", "expr", "argexpr", "listop", "@2",
+ "subbody", "package", "use", "$@1", "expr", "argexpr", "listop", "@2",
"method", "subscripted", "termbinop", "termunop", "anonymous", "termdo",
"term", "myattrterm", "myterm", "listexpr", "listexprcom", "my_scalar",
"amper", "scalar", "ary", "hsh", "arylen", "star", "indirob", 0
diff --git a/toke.c b/toke.c
index 2d383b3019..9df0ff25b0 100644
--- a/toke.c
+++ b/toke.c
@@ -7014,6 +7014,7 @@ Perl_yylex(pTHX)
case KEY_package:
s = force_word(s,WORD,FALSE,TRUE,FALSE);
+ s = SKIPSPACE1(s);
s = force_strict_version(s);
OPERATOR(PACKAGE);