diff options
author | Larry Wall <lwall@netlabs.com> | 1992-06-08 04:52:51 +0000 |
---|---|---|
committer | Larry Wall <lwall@netlabs.com> | 1992-06-08 04:52:51 +0000 |
commit | bf10efe7e35fa48859e575b890018da16608a9d7 (patch) | |
tree | 037a8f03dc53218bf7a65fa78aa32e90050697fb /x2p | |
parent | b3634b015bfd34ae2ab484f115256d52ae40d683 (diff) | |
download | perl-bf10efe7e35fa48859e575b890018da16608a9d7.tar.gz |
perl 4.0 patch 21: patch #20, continued
See patch #20.
Diffstat (limited to 'x2p')
-rw-r--r-- | x2p/Makefile.SH | 19 | ||||
-rw-r--r-- | x2p/a2p.h | 7 | ||||
-rw-r--r-- | x2p/a2p.y | 11 | ||||
-rw-r--r-- | x2p/a2py.c | 38 |
4 files changed, 53 insertions, 22 deletions
diff --git a/x2p/Makefile.SH b/x2p/Makefile.SH index a8a77175a2..6d8d735ca5 100644 --- a/x2p/Makefile.SH +++ b/x2p/Makefile.SH @@ -14,10 +14,16 @@ case $CONFIG in ;; esac echo "Extracting x2p/Makefile (with variable substitutions)" +rm -f Makefile cat >Makefile <<!GROK!THIS! -# $RCSfile: Makefile.SH,v $$Revision: 4.0.1.2 $$Date: 91/11/05 19:19:04 $ +# $RCSfile: Makefile.SH,v $$Revision: 4.0.1.3 $$Date: 92/06/08 16:11:32 $ # # $Log: Makefile.SH,v $ +# Revision 4.0.1.3 92/06/08 16:11:32 lwall +# patch20: SH files didn't work well with symbolic links +# patch20: cray didn't give enough memory to /bin/sh +# patch20: makefiles now display new shift/reduce expectations +# # Revision 4.0.1.2 91/11/05 19:19:04 lwall # patch11: random cleanup # @@ -40,13 +46,14 @@ SMALL = $small LARGE = $large $split mallocsrc = $mallocsrc mallocobj = $mallocobj +shellflags = $shellflags libs = $libs !GROK!THIS! cat >>Makefile <<'!NO!SUBS!' -CCCMD = `sh cflags $@` +CCCMD = `sh $(shellflags) cflags $@` public = a2p s2p find2perl @@ -58,7 +65,7 @@ util = sh = Makefile.SH makedepend.SH -h = EXTERN.h INTERN.h config.h handy.h hash.h a2p.h str.h util.h +h = EXTERN.h INTERN.h ../config.h handy.h hash.h a2p.h str.h util.h c = hash.c $(mallocsrc) str.c util.c walk.c @@ -81,7 +88,7 @@ a2p: $(obj) a2p.o $(CC) $(LDFLAGS) $(obj) a2p.o $(libs) -o a2p a2p.c: a2p.y - @ echo Expect 226 shift/reduce conflicts... + @ echo Expect 231 shift/reduce conflicts... $(YACC) a2p.y mv y.tab.c a2p.c @@ -105,7 +112,7 @@ done; \ fi clean: - rm -f a2p *.o + rm -f a2p *.o a2p.c realclean: clean rm -f *.orig */*.orig core $(addedbyconf) a2p.c s2p find2perl all cflags @@ -141,7 +148,7 @@ malloc.c: ../malloc.c $(obj): @ echo "You haven't done a "'"make depend" yet!'; exit 1 makedepend: makedepend.SH - /bin/sh makedepend.SH + /bin/sh $(shellflags) makedepend.SH !NO!SUBS! $eunicefix Makefile case `pwd` in @@ -1,4 +1,4 @@ -/* $RCSfile: a2p.h,v $$Revision: 4.0.1.1 $$Date: 91/06/07 12:12:27 $ +/* $RCSfile: a2p.h,v $$Revision: 4.0.1.2 $$Date: 92/06/08 16:12:23 $ * * Copyright (c) 1991, Larry Wall * @@ -6,6 +6,9 @@ * License or the Artistic License, as specified in the README file. * * $Log: a2p.h,v $ + * Revision 4.0.1.2 92/06/08 16:12:23 lwall + * patch20: hash tables now split only if the memory is available to do so + * * Revision 4.0.1.1 91/06/07 12:12:27 lwall * patch4: new copyright notice * @@ -295,6 +298,8 @@ EXT bool need_entire INIT(FALSE); EXT bool absmaxfld INIT(FALSE); EXT bool saw_altinput INIT(FALSE); +EXT bool nomemok INIT(FALSE); + EXT char const_FS INIT(0); EXT char *namelist INIT(Nullch); EXT char fswitch INIT(0); @@ -1,5 +1,5 @@ %{ -/* $RCSfile: a2p.y,v $$Revision: 4.0.1.1 $$Date: 91/06/07 12:12:41 $ +/* $RCSfile: a2p.y,v $$Revision: 4.0.1.2 $$Date: 92/06/08 16:13:03 $ * * Copyright (c) 1991, Larry Wall * @@ -7,6 +7,9 @@ * License or the Artistic License, as specified in the README file. * * $Log: a2p.y,v $ + * Revision 4.0.1.2 92/06/08 16:13:03 lwall + * patch20: in a2p, getline should allow variable to be array element + * * Revision 4.0.1.1 91/06/07 12:12:41 lwall * patch4: new copyright notice * @@ -184,18 +187,18 @@ term : variable { $$ = oper1(OPAREN,$2); } | GETLINE { $$ = oper0(OGETLINE); } - | GETLINE VAR + | GETLINE variable { $$ = oper1(OGETLINE,$2); } | GETLINE '<' expr { $$ = oper3(OGETLINE,Nullop,string("<",1),$3); if (ops[$3].ival != OSTR + (1<<8)) do_fancy_opens = TRUE; } - | GETLINE VAR '<' expr + | GETLINE variable '<' expr { $$ = oper3(OGETLINE,$2,string("<",1),$4); if (ops[$4].ival != OSTR + (1<<8)) do_fancy_opens = TRUE; } | term 'p' GETLINE { $$ = oper3(OGETLINE,Nullop,string("|",1),$1); if (ops[$1].ival != OSTR + (1<<8)) do_fancy_opens = TRUE; } - | term 'p' GETLINE VAR + | term 'p' GETLINE variable { $$ = oper3(OGETLINE,$4,string("|",1),$1); if (ops[$1].ival != OSTR + (1<<8)) do_fancy_opens = TRUE; } | FUN1 diff --git a/x2p/a2py.c b/x2p/a2py.c index b2ac121615..c785828712 100644 --- a/x2p/a2py.c +++ b/x2p/a2py.c @@ -1,4 +1,4 @@ -/* $RCSfile: a2py.c,v $$Revision: 4.0.1.1 $$Date: 91/06/07 12:12:59 $ +/* $RCSfile: a2py.c,v $$Revision: 4.0.1.2 $$Date: 92/06/08 16:15:16 $ * * Copyright (c) 1991, Larry Wall * @@ -6,6 +6,11 @@ * License or the Artistic License, as specified in the README file. * * $Log: a2py.c,v $ + * Revision 4.0.1.2 92/06/08 16:15:16 lwall + * patch20: in a2p, now warns about spurious backslashes + * patch20: in a2p, now allows [ to be backslashed in pattern + * patch20: in a2p, now allows numbers of the form 2. + * * Revision 4.0.1.1 91/06/07 12:12:59 lwall * patch4: new copyright notice * @@ -14,8 +19,8 @@ * */ -#ifdef MSDOS -#include "../patchlev.h" +#ifdef OS2 +#include "../patchlevel.h" #endif #include "util.h" char *index(); @@ -26,10 +31,10 @@ char *myname; int checkers = 0; STR *walk(); -#ifdef MSDOS +#ifdef OS2 usage() { - printf("\nThis is the AWK to PERL translator, version 3.0, patchlevel %d\n", PATCHLEVEL); + printf("\nThis is the AWK to PERL translator, version 4.0, patchlevel %d\n", PATCHLEVEL); printf("\nUsage: %s [-D<number>] [-F<char>] [-n<fieldlist>] [-<number>] filename\n", myname); printf("\n -D<number> sets debugging flags." "\n -F<character> the awk script to translate is always invoked with" @@ -85,7 +90,7 @@ register char **env; break; default: fatal("Unrecognized switch: %s\n",argv[0]); -#ifdef MSDOS +#ifdef OS2 usage(); #endif } @@ -95,7 +100,7 @@ register char **env; /* open script */ if (argv[0] == Nullch) { -#ifdef MSDOS +#ifdef OS2 if ( isatty(fileno(stdin)) ) usage(); #endif @@ -216,6 +221,12 @@ yylex() *s++,filename,line); goto retry; case '\\': + s++; + if (*s && *s != '\n') { + yyerror("Ignoring spurious backslash"); + goto retry; + } + /*FALLSTHROUGH*/ case 0: s = str_get(linestr); *s = '\0'; @@ -802,6 +813,8 @@ register char *s; *d++ = *s++; else if (s[1] == '\\') *d++ = *s++; + else if (s[1] == '[') + *d++ = *s++; } else if (*s == '[') { *d++ = *s++; @@ -846,11 +859,15 @@ register char *s; while (isdigit(*s)) { *d++ = *s++; } - if (*s == '.' && index("0123456789eE",s[1])) { - *d++ = *s++; - while (isdigit(*s)) { + if (*s == '.') { + if (isdigit(s[1])) { *d++ = *s++; + while (isdigit(*s)) { + *d++ = *s++; + } } + else + s++; } if (index("eE",*s) && index("+-0123456789",s[1])) { *d++ = *s++; @@ -1265,7 +1282,6 @@ int prevargs; sprintf(tmpbuf,"%s:%d",name,prevargs); str = hfetch(curarghash,tmpbuf); - fprintf(stderr,"Looking for %s\n",tmpbuf); if (str && strEQ(str->str_ptr,"*")) { if (type == OVAR || type == OSTAR) { ops[arg].ival &= ~255; |