search for: heredoclist

Displaying 10 results from an estimated 10 matches for "heredoclist".

2020 Mar 28
0
[klibc:update-dash] dash: parser: Save/restore here-documents in command substitution
...++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/usr/dash/parser.c b/usr/dash/parser.c index 8bd3db44..809c6a8a 100644 --- a/usr/dash/parser.c +++ b/usr/dash/parser.c @@ -1368,6 +1368,7 @@ parsebackq: { union node *n; char *str; size_t savelen; + struct heredoc *saveheredoclist; int uninitialized_var(saveprompt); str = NULL; @@ -1432,6 +1433,9 @@ done: *nlpp = (struct nodelist *)stalloc(sizeof (struct nodelist)); (*nlpp)->next = NULL; + saveheredoclist = heredoclist; + heredoclist = NULL; + if (oldstyle) { saveprompt = doprompt; doprompt = 0; @@ -14...
2019 Jan 25
0
[klibc:update-dash] [PARSER] Simplify EOF/newline handling in list parser
...ns(-) diff --git a/usr/dash/parser.c b/usr/dash/parser.c index f0c919d5..382ddf24 100644 --- a/usr/dash/parser.c +++ b/usr/dash/parser.c @@ -135,19 +135,13 @@ static inline int realeofmark(const char *eofmark) union node * parsecmd(int interact) { - int t; - tokpushback = 0; + checkkwd = 0; + heredoclist = 0; doprompt = interact; if (doprompt) setprompt(doprompt); needprompt = 0; - t = readtoken(); - if (t == TEOF) - return NEOF; - if (t == TNL) - return NULL; - tokpushback++; return list(1); } @@ -158,11 +152,27 @@ list(int nlflag) union node *n1, *n2, *n3; int tok; - checkkw...
2020 Mar 28
0
[klibc:update-dash] dash: [PARSER] Simplify EOF/newline handling in list parser
...ns(-) diff --git a/usr/dash/parser.c b/usr/dash/parser.c index f0c919d5..382ddf24 100644 --- a/usr/dash/parser.c +++ b/usr/dash/parser.c @@ -135,19 +135,13 @@ static inline int realeofmark(const char *eofmark) union node * parsecmd(int interact) { - int t; - tokpushback = 0; + checkkwd = 0; + heredoclist = 0; doprompt = interact; if (doprompt) setprompt(doprompt); needprompt = 0; - t = readtoken(); - if (t == TEOF) - return NEOF; - if (t == TNL) - return NULL; - tokpushback++; return list(1); } @@ -158,11 +152,27 @@ list(int nlflag) union node *n1, *n2, *n3; int tok; - checkkw...
2019 Jan 25
0
[klibc:update-dash] [PARSER] Removed unnecessary pungetc on EOF from parser
...Ben Hutchings <ben at decadent.org.uk> --- usr/dash/parser.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/usr/dash/parser.c b/usr/dash/parser.c index f6c43be0..f0c919d5 100644 --- a/usr/dash/parser.c +++ b/usr/dash/parser.c @@ -208,8 +208,6 @@ list(int nlflag) case TEOF: if (heredoclist) parseheredoc(); - else - pungetc(); /* push back EOF on input */ tokpushback++; return n1; default:
2020 Mar 28
0
[klibc:update-dash] dash: [PARSER] Removed unnecessary pungetc on EOF from parser
...Ben Hutchings <ben at decadent.org.uk> --- usr/dash/parser.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/usr/dash/parser.c b/usr/dash/parser.c index f6c43be0..f0c919d5 100644 --- a/usr/dash/parser.c +++ b/usr/dash/parser.c @@ -208,8 +208,6 @@ list(int nlflag) case TEOF: if (heredoclist) parseheredoc(); - else - pungetc(); /* push back EOF on input */ tokpushback++; return n1; default:
2020 Mar 28
0
[klibc:update-dash] dash: parser: Fix old-style command substitution here-document crash
...n(+), 1 deletion(-) diff --git a/usr/dash/parser.c b/usr/dash/parser.c index 1f9e8ec0..4bda42e8 100644 --- a/usr/dash/parser.c +++ b/usr/dash/parser.c @@ -1451,9 +1451,9 @@ done: if (readtoken() != TRP) synexpect(TRP); setinputstring(nullstr); - parseheredoc(); } + parseheredoc(); heredoclist = saveheredoclist; (*nlpp)->n = n;
2019 Jan 25
0
[klibc:update-dash] [SHELL] Optimize dash -c "command" to avoid a fork
...diff --git a/usr/dash/parser.c b/usr/dash/parser.c index 6e076a59..572cbcd5 100644 --- a/usr/dash/parser.c +++ b/usr/dash/parser.c @@ -64,7 +64,7 @@ */ /* values returned by readtoken */ -#include "token.h" +#include "token_vars.h" @@ -86,7 +86,7 @@ struct heredoc *heredoclist; /* list of here documents to read */ int doprompt; /* if set, prompt the user */ int needprompt; /* true if interactive and at start of line */ int lasttoken; /* last token read */ -MKINIT int tokpushback; /* last token pushed back */ +int tokpushback; /* last token pushed back */ char...
2020 Mar 28
0
[klibc:update-dash] dash: [SHELL] Optimize dash -c "command" to avoid a fork
...diff --git a/usr/dash/parser.c b/usr/dash/parser.c index 6e076a59..572cbcd5 100644 --- a/usr/dash/parser.c +++ b/usr/dash/parser.c @@ -64,7 +64,7 @@ */ /* values returned by readtoken */ -#include "token.h" +#include "token_vars.h" @@ -86,7 +86,7 @@ struct heredoc *heredoclist; /* list of here documents to read */ int doprompt; /* if set, prompt the user */ int needprompt; /* true if interactive and at start of line */ int lasttoken; /* last token read */ -MKINIT int tokpushback; /* last token pushed back */ +int tokpushback; /* last token pushed back */ char...
2019 Jan 25
0
[klibc:update-dash] parser: Add syntax stack for recursive parsing
...synstack *prev; + struct synstack *next; + int innerdq; + int varpushed; + int dblquote; + int varnest; /* levels of variables expansion */ + int parenlevel; /* levels of parens in arithmetic */ + int dqvarnest; /* levels of variables expansion within double quotes */ +}; + struct heredoc *heredoclist; /* list of here documents to read */ @@ -841,6 +853,21 @@ static int pgetc_eatbnl(void) return c; } +static void synstack_push(struct synstack **stack, struct synstack *next, + const char *syntax) +{ + memset(next, 0, sizeof(*next)); + next->syntax = syntax; + next->next = *stack; +...
2020 Mar 28
0
[klibc:update-dash] dash: parser: Add syntax stack for recursive parsing
...synstack *prev; + struct synstack *next; + int innerdq; + int varpushed; + int dblquote; + int varnest; /* levels of variables expansion */ + int parenlevel; /* levels of parens in arithmetic */ + int dqvarnest; /* levels of variables expansion within double quotes */ +}; + struct heredoc *heredoclist; /* list of here documents to read */ @@ -841,6 +853,21 @@ static int pgetc_eatbnl(void) return c; } +static void synstack_push(struct synstack **stack, struct synstack *next, + const char *syntax) +{ + memset(next, 0, sizeof(*next)); + next->syntax = syntax; + next->next = *stack; +...