-/* $Header: toke.c,v 3.0 89/10/18 15:32:33 lwall Locked $
+/* $Header: toke.c,v 3.0.1.2 89/11/11 05:04:42 lwall Locked $
*
* Copyright (c) 1989, Larry Wall
*
* as specified in the README file that comes with the perl 3.0 kit.
*
* $Log: toke.c,v $
+ * Revision 3.0.1.2 89/11/11 05:04:42 lwall
+ * patch2: fixed a CLINE macro conflict
+ *
+ * Revision 3.0.1.1 89/10/26 23:26:21 lwall
+ * patch1: disambiguated word after "sort" better
+ *
* Revision 3.0 89/10/18 15:32:33 lwall
* 3.0 baseline
*
char *reparse; /* if non-null, scanreg found ${foo[$bar]} */
+#ifdef CLINE
+#undef CLINE
+#endif
#define CLINE (cmdline = (line < cmdline ? line : cmdline))
#define META(c) ((c) | 128)
retry:
#ifdef YYDEBUG
- if (yydebug)
+ if (debug & 1)
if (index(s,'\n'))
fprintf(stderr,"Tokener at %s",s);
else
}
#endif
bufend = linestr->str_ptr + linestr->str_cur;
- firstline = FALSE;
+ if (firstline) {
+ while (s < bufend && isspace(*s))
+ s++;
+ if (*s == ':') /* for csh's that have to exec sh scripts */
+ s++;
+ firstline = FALSE;
+ }
goto retry;
case ' ': case '\t': case '\f':
s++;
fatal("sort is now a reserved word");
if (isascii(*s) && (isalpha(*s) || *s == '_')) {
for (d = s; isalpha(*d) || isdigit(*d) || *d == '_'; d++) ;
- if (d >= bufend || isspace(*d))
+ strncpy(tokenbuf,s,d-s);
+ if (strNE(tokenbuf,"keys") &&
+ strNE(tokenbuf,"values") &&
+ strNE(tokenbuf,"split") &&
+ strNE(tokenbuf,"grep") &&
+ strNE(tokenbuf,"readdir") &&
+ strNE(tokenbuf,"unpack") &&
+ strNE(tokenbuf,"do") &&
+ (d >= bufend || isspace(*d)) )
*(--s) = '\\'; /* force next ident to WORD */
}
LOP(O_SORT);
set_csh()
{
- if (!csh) {
- if (stat("/bin/csh",&statbuf) < 0)
- csh = -1;
- else
- csh = 1;
- }
+#ifdef CSH
+ if (!cshlen)
+ cshlen = strlen(cshname);
+#endif
}