diff options
Diffstat (limited to 'src/parser.h')
-rw-r--r-- | src/parser.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/parser.h b/src/parser.h index e6caed6..2875cce 100644 --- a/src/parser.h +++ b/src/parser.h @@ -34,6 +34,8 @@ * @(#)parser.h 8.3 (Berkeley) 5/4/95 */ +#include "token.h" + /* control characters in argument strings */ #define CTL_FIRST -127 /* first 'special' character */ #define CTLESC -127 /* escape next character */ @@ -73,6 +75,7 @@ * must be distinct from NULL, so we use the address of a variable that * happens to be handy. */ +extern int lasttoken; extern int tokpushback; #define NEOF ((union node *)&tokpushback) extern int whichprompt; /* 1 == PS1, 2 == PS2 */ @@ -91,3 +94,8 @@ goodname(const char *p) { return !*endofname(p); } + +static inline int parser_eof(void) +{ + return tokpushback && lasttoken == TEOF; +} |