Displaying 8 results from an estimated 8 matches for "pgetc2".
Did you mean:
pgetc
2019 Jan 25
0
[klibc:update-dash] [INPUT] Kill pgetc_macro
...t.c b/usr/dash/input.c
index d31c45bb..9e533a47 100644
--- a/usr/dash/input.c
+++ 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 p...
2019 Jan 25
0
[klibc:update-dash] input: Make preadbuffer static
...uffer(void)
+static int preadbuffer(void)
{
char *q;
int more;
diff --git a/usr/dash/input.h b/usr/dash/input.h
index 775291b8..90ff6c33 100644
--- a/usr/dash/input.h
+++ b/usr/dash/input.h
@@ -52,7 +52,6 @@ extern char *parsenextc; /* next character in input buffer */
int pgetc(void);
int pgetc2(void);
-int preadbuffer(void);
void pungetc(void);
void pushstring(char *, void *);
void popstring(void);
2020 Mar 28
0
[klibc:update-dash] dash: [INPUT] Kill pgetc_macro
...t.c b/usr/dash/input.c
index d31c45bb..9e533a47 100644
--- a/usr/dash/input.c
+++ 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 p...
2020 Mar 28
0
[klibc:update-dash] dash: input: Make preadbuffer static
...uffer(void)
+static int preadbuffer(void)
{
char *q;
int more;
diff --git a/usr/dash/input.h b/usr/dash/input.h
index 775291b8..90ff6c33 100644
--- a/usr/dash/input.h
+++ b/usr/dash/input.h
@@ -52,7 +52,6 @@ extern char *parsenextc; /* next character in input buffer */
int pgetc(void);
int pgetc2(void);
-int preadbuffer(void);
void pungetc(void);
void pushstring(char *, void *);
void popstring(void);
2019 Jan 25
0
[klibc:update-dash] parser: use pgetc_eatbnl() in more places
...39;:
RETURN(TRP);
- default:
- goto breakloop;
}
+ break;
}
-breakloop:
return readtoken1(c, BASESYNTAX, (char *)NULL, 0);
#undef RETURN
}
@@ -836,7 +830,7 @@ static int pgetc_eatbnl(void)
int c;
while ((c = pgetc()) == '\\') {
- if (pgetc() != '\n') {
+ if (pgetc2() != '\n') {
pungetc();
break;
}
@@ -903,7 +897,7 @@ readtoken1(int firstc, char const *syntax, char *eofmark, int striptabs)
attyline();
if (syntax == BASESYNTAX)
return readtoken();
- c = pgetc();
+ c = syntax == SQSYNTAX ? pgetc() : pgetc_eatbnl();
goto lo...
2020 Mar 28
0
[klibc:update-dash] dash: parser: use pgetc_eatbnl() in more places
...39;:
RETURN(TRP);
- default:
- goto breakloop;
}
+ break;
}
-breakloop:
return readtoken1(c, BASESYNTAX, (char *)NULL, 0);
#undef RETURN
}
@@ -836,7 +830,7 @@ static int pgetc_eatbnl(void)
int c;
while ((c = pgetc()) == '\\') {
- if (pgetc() != '\n') {
+ if (pgetc2() != '\n') {
pungetc();
break;
}
@@ -903,7 +897,7 @@ readtoken1(int firstc, char const *syntax, char *eofmark, int striptabs)
attyline();
if (syntax == BASESYNTAX)
return readtoken();
- c = pgetc();
+ c = syntax == SQSYNTAX ? pgetc() : pgetc_eatbnl();
goto lo...
2019 Jan 25
0
[klibc:update-dash] input: Move all input state into parsefile
...es are pushed and popped. The user of this
* package must set its value.
*/
-extern int plinno;
-extern int parsenleft; /* number of characters left in input buffer */
-extern char *parsenextc; /* next character in input buffer */
+#define plinno (parsefile->linno)
int pgetc(void);
int pgetc2(void);
2020 Mar 28
0
[klibc:update-dash] dash: input: Move all input state into parsefile
...es are pushed and popped. The user of this
* package must set its value.
*/
-extern int plinno;
-extern int parsenleft; /* number of characters left in input buffer */
-extern char *parsenextc; /* next character in input buffer */
+#define plinno (parsefile->linno)
int pgetc(void);
int pgetc2(void);