search for: peof

Displaying 12 results from an estimated 12 matches for "peof".

Did you mean: eof
2019 Jan 25
0
[klibc:update-dash] [PARSER] Add nlprompt/nlnoprompt helpers
...continue; case '\\': if (pgetc() == '\n') { - plinno++; - if (doprompt) - setprompt(2); + nlprompt(); continue; } pungetc(); goto breakloop; case '\n': - plinno++; - needprompt = doprompt; + nlnoprompt(); RETURN(TNL); case PEOF: RETURN(TEOF); @@ -837,9 +847,7 @@ static int pgetc_eatbnl(void) break; } - plinno++; - if (doprompt) - setprompt(2); + nlprompt(); } return c; @@ -913,9 +921,7 @@ readtoken1(int firstc, char const *syntax, char *eofmark, int striptabs) if (syntax == BASESYNTAX) g...
2020 Mar 28
0
[klibc:update-dash] dash: [PARSER] Add nlprompt/nlnoprompt helpers
...continue; case '\\': if (pgetc() == '\n') { - plinno++; - if (doprompt) - setprompt(2); + nlprompt(); continue; } pungetc(); goto breakloop; case '\n': - plinno++; - needprompt = doprompt; + nlnoprompt(); RETURN(TNL); case PEOF: RETURN(TEOF); @@ -837,9 +847,7 @@ static int pgetc_eatbnl(void) break; } - plinno++; - if (doprompt) - setprompt(2); + nlprompt(); } return c; @@ -913,9 +921,7 @@ readtoken1(int firstc, char const *syntax, char *eofmark, int striptabs) if (syntax == BASESYNTAX) g...
2019 Jan 25
0
[klibc:update-dash] parser: use pgetc_eatbnl() in more places
...xxreadtoken(void) setprompt(2); } for (;;) { /* until token or start of word found */ - c = pgetc(); + c = pgetc_eatbnl(); switch (c) { case ' ': case '\t': case PEOA: @@ -791,30 +794,23 @@ xxreadtoken(void) while ((c = pgetc()) != '\n' && c != PEOF); pungetc(); continue; - case '\\': - if (pgetc() == '\n') { - nlprompt(); - continue; - } - pungetc(); - goto breakloop; case '\n': nlnoprompt(); RETURN(TNL); case PEOF: RETURN(TEOF); case '&': - if (pgetc() == '...
2020 Mar 28
0
[klibc:update-dash] dash: parser: use pgetc_eatbnl() in more places
...xxreadtoken(void) setprompt(2); } for (;;) { /* until token or start of word found */ - c = pgetc(); + c = pgetc_eatbnl(); switch (c) { case ' ': case '\t': case PEOA: @@ -791,30 +794,23 @@ xxreadtoken(void) while ((c = pgetc()) != '\n' && c != PEOF); pungetc(); continue; - case '\\': - if (pgetc() == '\n') { - nlprompt(); - continue; - } - pungetc(); - goto breakloop; case '\n': nlnoprompt(); RETURN(TNL); case PEOF: RETURN(TEOF); case '&': - if (pgetc() == '...
2019 Jan 25
0
[klibc:update-dash] input: Move all input state into parsefile
...0) - return (signed char)*parsenextc++; + if (--parsefile->nleft >= 0) + return (signed char)*parsefile->nextc++; } - if (unlikely(parsenleft == EOF_NLEFT || parsefile->buf == NULL)) + if (unlikely(parsefile->nleft == EOF_NLEFT || + parsefile->buf == NULL)) return PEOF; flushall(); - more = parselleft; + more = parsefile->lleft; if (more <= 0) { again: if ((more = preadfd()) <= 0) { - parselleft = parsenleft = EOF_NLEFT; + parsefile->lleft = parsefile->nleft = EOF_NLEFT; return PEOF; } } - q = parsenextc; + q = parsefile-&g...
2020 Mar 28
0
[klibc:update-dash] dash: input: Move all input state into parsefile
...0) - return (signed char)*parsenextc++; + if (--parsefile->nleft >= 0) + return (signed char)*parsefile->nextc++; } - if (unlikely(parsenleft == EOF_NLEFT || parsefile->buf == NULL)) + if (unlikely(parsefile->nleft == EOF_NLEFT || + parsefile->buf == NULL)) return PEOF; flushall(); - more = parselleft; + more = parsefile->lleft; if (more <= 0) { again: if ((more = preadfd()) <= 0) { - parselleft = parsenleft = EOF_NLEFT; + parsefile->lleft = parsefile->nleft = EOF_NLEFT; return PEOF; } } - q = parsenextc; + q = parsefile-&g...
2019 Jan 25
0
[klibc:update-dash] [INPUT] Replace open-coded flushall in preadbuffer
...1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/usr/dash/input.c b/usr/dash/input.c index 9e533a47..f11ac842 100644 --- a/usr/dash/input.c +++ b/usr/dash/input.c @@ -245,10 +245,7 @@ preadbuffer(void) } if (unlikely(parsenleft == EOF_NLEFT || parsefile->buf == NULL)) return PEOF; - flushout(&output); -#ifdef FLUSHERR - flushout(&errout); -#endif + flushall(); more = parselleft; if (more <= 0) {
2020 Mar 28
0
[klibc:update-dash] dash: [INPUT] Replace open-coded flushall in preadbuffer
...1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/usr/dash/input.c b/usr/dash/input.c index 9e533a47..f11ac842 100644 --- a/usr/dash/input.c +++ b/usr/dash/input.c @@ -245,10 +245,7 @@ preadbuffer(void) } if (unlikely(parsenleft == EOF_NLEFT || parsefile->buf == NULL)) return PEOF; - flushout(&output); -#ifdef FLUSHERR - flushout(&errout); -#endif + flushall(); more = parselleft; if (more <= 0) {
2019 Jan 25
0
[klibc:update-dash] input: Allow two consecutive calls to pungetc
...extc++; + return pgetc(); } if (unlikely(parsefile->nleft == EOF_NLEFT || parsefile->buf == NULL)) @@ -290,15 +299,14 @@ again: } /* - * Undo the last call to pgetc. Only one character may be pushed back. + * Undo a call to pgetc. Only two characters may be pushed back. * PEOF may be pushed back. */ void pungetc(void) { - parsefile->nleft++; - parsefile->nextc--; + parsefile->unget++; } /* @@ -322,6 +330,8 @@ pushstring(char *s, void *ap) sp = parsefile->strpush = &(parsefile->basestrpush); sp->prevstring = parsefile->nextc; sp-...
2020 Mar 28
0
[klibc:update-dash] dash: input: Allow two consecutive calls to pungetc
...extc++; + return pgetc(); } if (unlikely(parsefile->nleft == EOF_NLEFT || parsefile->buf == NULL)) @@ -290,15 +299,14 @@ again: } /* - * Undo the last call to pgetc. Only one character may be pushed back. + * Undo a call to pgetc. Only two characters may be pushed back. * PEOF may be pushed back. */ void pungetc(void) { - parsefile->nleft++; - parsefile->nextc--; + parsefile->unget++; } /* @@ -322,6 +330,8 @@ pushstring(char *s, void *ap) sp = parsefile->strpush = &(parsefile->basestrpush); sp->prevstring = parsefile->nextc; sp-...
2019 Jan 25
0
[klibc:update-dash] parser: Add syntax stack for recursive parsing
...attyline(); - if (syntax == BASESYNTAX) + if (synstack->syntax == BASESYNTAX) return readtoken(); c = syntax == SQSYNTAX ? pgetc() : pgetc_eatbnl(); goto loop; @@ -904,9 +922,9 @@ readtoken1(int firstc, char const *syntax, char *eofmark, int striptabs) CHECKEND(); /* set c to PEOF if at end of here document */ for (;;) { /* until end of line or end of word */ CHECKSTRSPACE(4, out); /* permit 4 calls to USTPUTC */ - switch(syntax[c]) { + switch(synstack->syntax[c]) { case CNL: /* '\n' */ - if (syntax == BASESYNTAX) + if (synstack->syntax ==...
2020 Mar 28
0
[klibc:update-dash] dash: parser: Add syntax stack for recursive parsing
...attyline(); - if (syntax == BASESYNTAX) + if (synstack->syntax == BASESYNTAX) return readtoken(); c = syntax == SQSYNTAX ? pgetc() : pgetc_eatbnl(); goto loop; @@ -904,9 +922,9 @@ readtoken1(int firstc, char const *syntax, char *eofmark, int striptabs) CHECKEND(); /* set c to PEOF if at end of here document */ for (;;) { /* until end of line or end of word */ CHECKSTRSPACE(4, out); /* permit 4 calls to USTPUTC */ - switch(syntax[c]) { + switch(synstack->syntax[c]) { case CNL: /* '\n' */ - if (syntax == BASESYNTAX) + if (synstack->syntax ==...