Displaying 12 results from an estimated 12 matches for "peoa".
Did you mean:
peda
2019 Jan 25
0
[klibc:update-dash] [INPUT] Kill pgetc_macro
...b/usr/dash/input.c
@@ -134,7 +134,10 @@ RESET {
int
pgetc(void)
{
- return pgetc_macro();
+ if (--parsenleft >= 0)
+ return (signed char)*parsenextc++;
+ else
+ return preadbuffer();
}
@@ -147,7 +150,7 @@ pgetc2()
{
int c;
do {
- c = pgetc_macro();
+ c = pgetc();
} while (c == PEOA);
return c;
}
diff --git a/usr/dash/input.h b/usr/dash/input.h
index 50a77971..775291b8 100644
--- a/usr/dash/input.h
+++ b/usr/dash/input.h
@@ -61,6 +61,3 @@ void setinputstring(char *);
void popfile(void);
void popallfiles(void);
void closescript(void);
-
-#define pgetc_macro() \
- (--parse...
2020 Mar 28
0
[klibc:update-dash] dash: [INPUT] Kill pgetc_macro
...b/usr/dash/input.c
@@ -134,7 +134,10 @@ RESET {
int
pgetc(void)
{
- return pgetc_macro();
+ if (--parsenleft >= 0)
+ return (signed char)*parsenextc++;
+ else
+ return preadbuffer();
}
@@ -147,7 +150,7 @@ pgetc2()
{
int c;
do {
- c = pgetc_macro();
+ c = pgetc();
} while (c == PEOA);
return c;
}
diff --git a/usr/dash/input.h b/usr/dash/input.h
index 50a77971..775291b8 100644
--- a/usr/dash/input.h
+++ b/usr/dash/input.h
@@ -61,6 +61,3 @@ void setinputstring(char *);
void popfile(void);
void popallfiles(void);
void closescript(void);
-
-#define pgetc_macro() \
- (--parse...
2019 Jan 25
0
[klibc:update-dash] parser: Add syntax stack for recursive parsing
...syntax = prevsyntax;
+ synstack_pop(&synstack);
} else {
/*
* unbalanced parens
@@ -1011,7 +1043,7 @@ quotemark:
case CIGN:
break;
default:
- if (varnest == 0)
+ if (synstack->varnest == 0)
goto endword; /* exit outer loop */
if (c != PEOA) {
USTPUTC(c, out);
@@ -1021,11 +1053,11 @@ quotemark:
}
}
endword:
- if (syntax == ARISYNTAX)
+ if (synstack->syntax == ARISYNTAX)
synerror("Missing '))'");
- if (syntax != BASESYNTAX && eofmark == NULL)
+ if (synstack->syntax != BASESYNTAX &&...
2020 Mar 28
0
[klibc:update-dash] dash: parser: Add syntax stack for recursive parsing
...syntax = prevsyntax;
+ synstack_pop(&synstack);
} else {
/*
* unbalanced parens
@@ -1011,7 +1043,7 @@ quotemark:
case CIGN:
break;
default:
- if (varnest == 0)
+ if (synstack->varnest == 0)
goto endword; /* exit outer loop */
if (c != PEOA) {
USTPUTC(c, out);
@@ -1021,11 +1053,11 @@ quotemark:
}
}
endword:
- if (syntax == ARISYNTAX)
+ if (synstack->syntax == ARISYNTAX)
synerror("Missing '))'");
- if (syntax != BASESYNTAX && eofmark == NULL)
+ if (synstack->syntax != BASESYNTAX &&...
2019 Jan 25
0
[klibc:update-dash] [PARSER] Handle backslash newlines properly after dollar sign
...{
+ pungetc();
+ break;
+ }
+
+ plinno++;
+ if (doprompt)
+ setprompt(2);
+ }
+
+ return c;
+}
+
/*
@@ -1179,7 +1197,7 @@ parsesub: {
char *p;
static const char types[] = "}-+?=";
- c = pgetc();
+ c = pgetc_eatbnl();
if (
(checkkwd & CHKEOFMARK) ||
c <= PEOA ||
@@ -1188,7 +1206,7 @@ parsesub: {
USTPUTC('$', out);
pungetc();
} else if (c == '(') { /* $(command) or $((arith)) */
- if (pgetc() == '(') {
+ if (pgetc_eatbnl() == '(') {
PARSEARITH();
} else {
pungetc();
@@ -1200,25 +1218,25 @@ parsesub: {...
2020 Mar 28
0
[klibc:update-dash] dash: [PARSER] Handle backslash newlines properly after dollar sign
...{
+ pungetc();
+ break;
+ }
+
+ plinno++;
+ if (doprompt)
+ setprompt(2);
+ }
+
+ return c;
+}
+
/*
@@ -1179,7 +1197,7 @@ parsesub: {
char *p;
static const char types[] = "}-+?=";
- c = pgetc();
+ c = pgetc_eatbnl();
if (
(checkkwd & CHKEOFMARK) ||
c <= PEOA ||
@@ -1188,7 +1206,7 @@ parsesub: {
USTPUTC('$', out);
pungetc();
} else if (c == '(') { /* $(command) or $((arith)) */
- if (pgetc() == '(') {
+ if (pgetc_eatbnl() == '(') {
PARSEARITH();
} else {
pungetc();
@@ -1200,25 +1218,25 @@ parsesub: {...
2019 Jan 25
0
[klibc:update-dash] input: Allow two consecutive calls to pungetc
...204,7 @@ static int preadbuffer(void)
#endif
char savec;
- while (unlikely(parsefile->strpush)) {
+ if (unlikely(parsefile->strpush)) {
if (
parsefile->nleft == -1 &&
parsefile->strpush->ap &&
@@ -204,8 +214,7 @@ static int preadbuffer(void)
return PEOA;
}
popstring();
- if (--parsefile->nleft >= 0)
- return (signed char)*parsefile->nextc++;
+ return pgetc();
}
if (unlikely(parsefile->nleft == EOF_NLEFT ||
parsefile->buf == NULL))
@@ -290,15 +299,14 @@ again:
}
/*
- * Undo the last call to pgetc. Only one...
2020 Mar 28
0
[klibc:update-dash] dash: input: Allow two consecutive calls to pungetc
...204,7 @@ static int preadbuffer(void)
#endif
char savec;
- while (unlikely(parsefile->strpush)) {
+ if (unlikely(parsefile->strpush)) {
if (
parsefile->nleft == -1 &&
parsefile->strpush->ap &&
@@ -204,8 +214,7 @@ static int preadbuffer(void)
return PEOA;
}
popstring();
- if (--parsefile->nleft >= 0)
- return (signed char)*parsefile->nextc++;
+ return pgetc();
}
if (unlikely(parsefile->nleft == EOF_NLEFT ||
parsefile->buf == NULL))
@@ -290,15 +299,14 @@ again:
}
/*
- * Undo the last call to pgetc. Only one...
2019 Jan 25
0
[klibc:update-dash] parser: use pgetc_eatbnl() in more places
...talloc(sizeof (struct narg));
n->narg.type = NARG;
n->narg.next = NULL;
@@ -782,7 +785,7 @@ 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':
nlnopromp...
2020 Mar 28
0
[klibc:update-dash] dash: parser: use pgetc_eatbnl() in more places
...talloc(sizeof (struct narg));
n->narg.type = NARG;
n->narg.next = NULL;
@@ -782,7 +785,7 @@ 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':
nlnopromp...
2019 Jan 25
0
[klibc:update-dash] input: Move all input state into parsefile
...push->ap &&
- parsenextc[-1] != ' ' && parsenextc[-1] != '\t'
+ parsefile->nleft == -1 &&
+ parsefile->strpush->ap &&
+ parsefile->nextc[-1] != ' ' &&
+ parsefile->nextc[-1] != '\t'
) {
return PEOA;
}
popstring();
- if (--parsenleft >= 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 |...
2020 Mar 28
0
[klibc:update-dash] dash: input: Move all input state into parsefile
...push->ap &&
- parsenextc[-1] != ' ' && parsenextc[-1] != '\t'
+ parsefile->nleft == -1 &&
+ parsefile->strpush->ap &&
+ parsefile->nextc[-1] != ' ' &&
+ parsefile->nextc[-1] != '\t'
) {
return PEOA;
}
popstring();
- if (--parsenleft >= 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 |...