diff options
| author | Peter Stephenson <pws@users.sourceforge.net> | 2010-12-14 10:35:38 +0000 |
|---|---|---|
| committer | Peter Stephenson <pws@users.sourceforge.net> | 2010-12-14 10:35:38 +0000 |
| commit | ebcead7543194819ef3bbd47ef384cabae3c59fc (patch) | |
| tree | 6b5f55ab93d2b7a01aaa11dbb055e38173e3b70e | |
| parent | 28528: Rearrange zleparse to lexflags (diff) | |
| download | zsh-ebcead7543194819ef3bbd47ef384cabae3c59fc.tar zsh-ebcead7543194819ef3bbd47ef384cabae3c59fc.tar.gz zsh-ebcead7543194819ef3bbd47ef384cabae3c59fc.tar.bz2 zsh-ebcead7543194819ef3bbd47ef384cabae3c59fc.tar.lz zsh-ebcead7543194819ef3bbd47ef384cabae3c59fc.tar.xz zsh-ebcead7543194819ef3bbd47ef384cabae3c59fc.tar.zst zsh-ebcead7543194819ef3bbd47ef384cabae3c59fc.zip | |
lexsave/lexrestore lexflags
add new LEXFLAGS_ZLE
| -rw-r--r-- | ChangeLog | 7 | ||||
| -rw-r--r-- | Src/Zle/compcore.c | 4 | ||||
| -rw-r--r-- | Src/Zle/compctl.c | 8 | ||||
| -rw-r--r-- | Src/Zle/zle_tricky.c | 7 | ||||
| -rw-r--r-- | Src/hist.c | 11 | ||||
| -rw-r--r-- | Src/lex.c | 7 | ||||
| -rw-r--r-- | Src/zsh.h | 12 |
7 files changed, 33 insertions, 23 deletions
@@ -1,5 +1,10 @@ 2010-12-14 Peter Stephenson <pws@csr.com> + * 28529: Src/hist.c, Src/lex.c, Src/zsh.h, Src/Zle/compcore.c, + Src/Zle/compctl.c, Src/Zle/zle_tricky.c: save and restore + lexflags and separate out special word logic for ZLE by + adding new flag LEXFLAGS_ZLE. + * 28528: Doc/Zsh/expn.yo, Src/hist.c, Src/lex.c, Src/subst.c, Src/zsh.h, Src/Zle/compcore.c, Src/Zle/compctl.c, Src/Zle/zle_tricky.c, Test/D04parameter.ztst: clear up use of @@ -13950,5 +13955,5 @@ ***************************************************** * This is used by the shell to define $ZSH_PATCHLEVEL -* $Revision: 1.5149 $ +* $Revision: 1.5150 $ ***************************************************** diff --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c index 2e983f62c..c59815874 100644 --- a/Src/Zle/compcore.c +++ b/Src/Zle/compcore.c @@ -1481,13 +1481,13 @@ set_comp_sep(void) /* Put the string in the lexer buffer and call the lexer to * * get the words we have to expand. */ - lexflags = LEXFLAGS_ACTIVE; ocs = zlemetacs; oll = zlemetall; ol = zlemetaline; addedx = 1; noerrs = 1; lexsave(); + lexflags = LEXFLAGS_ZLE; /* * tl is the length of the temporary string including * the space at the start and the x at the cursor position, @@ -1634,7 +1634,7 @@ set_comp_sep(void) noaliases = ona; strinend(); inpop(); - errflag = lexflags = 0; + errflag = 0; noerrs = ne; lexrestore(); wb = owb; diff --git a/Src/Zle/compctl.c b/Src/Zle/compctl.c index 4e28fd67c..873d9287a 100644 --- a/Src/Zle/compctl.c +++ b/Src/Zle/compctl.c @@ -2789,10 +2789,10 @@ sep_comp_string(char *ss, char *s, int noffs) /* Put the string in the lexer buffer and call the lexer to * * get the words we have to expand. */ - lexflags = LEXFLAGS_ACTIVE; addedx = 1; noerrs = 1; lexsave(); + lexflags = LEXFLAGS_ZLE; tmp = (char *) zhalloc(tl = sl + 3 + strlen(s)); strcpy(tmp, ss); tmp[sl] = ' '; @@ -2843,7 +2843,7 @@ sep_comp_string(char *ss, char *s, int noffs) noaliases = ona; strinend(); inpop(); - errflag = lexflags = 0; + errflag = 0; noerrs = ne; lexrestore(); wb = owb; @@ -3703,8 +3703,8 @@ makecomplistflags(Compctl cc, char *s, int incmd, int compadd) /* Put the string in the lexer buffer and call the lexer to * * get the words we have to expand. */ - lexflags = LEXFLAGS_ACTIVE; lexsave(); + lexflags = LEXFLAGS_ZLE; tmpbuf = (char *)zhalloc(strlen(cc->str) + 5); sprintf(tmpbuf, "foo %s", cc->str); /* KLUDGE! */ inpush(tmpbuf, 0, NULL); @@ -3721,7 +3721,7 @@ makecomplistflags(Compctl cc, char *s, int incmd, int compadd) noaliases = ona; strinend(); inpop(); - errflag = lexflags = 0; + errflag = 0; lexrestore(); /* Fine, now do full expansion. */ prefork(foo, 0); diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c index 9a63b2738..566537761 100644 --- a/Src/Zle/zle_tricky.c +++ b/Src/Zle/zle_tricky.c @@ -1140,9 +1140,9 @@ get_comp_string(void) zsfree(varname); varname = NULL; insubscr = 0; - lexflags = LEXFLAGS_ACTIVE; clwpos = -1; lexsave(); + lexflags = LEXFLAGS_ZLE; inpush(dupstrspace(linptr), 0, NULL); strinbeg(0); wordpos = tt0 = cp = rd = ins = oins = linarr = parct = ia = redirpos = 0; @@ -2707,7 +2707,6 @@ doexpandhist(void) noaliases = ona; strinend(); inpop(); - lexflags = 0; lexrestore(); expanding = 0; @@ -2807,8 +2806,8 @@ getcurcmd(void) int curlincmd; char *s = NULL; - lexflags = LEXFLAGS_ACTIVE; lexsave(); + lexflags = LEXFLAGS_ZLE; metafy_line(); inpush(dupstrspace(zlemetaline), 0, NULL); strinbeg(1); @@ -2829,7 +2828,7 @@ getcurcmd(void) popheap(); strinend(); inpop(); - errflag = lexflags = 0; + errflag = 0; unmetafy_line(); lexrestore(); diff --git a/Src/hist.c b/Src/hist.c index ae7ada755..c94d3e4aa 100644 --- a/Src/hist.c +++ b/Src/hist.c @@ -2897,11 +2897,9 @@ histfileIsLocked(void) * If index is non-NULL, and input is from a string in ZLE, *index * is set to the position of the end of the current editor word. * - * comments is used if buf is non-NULL (i.e. this is not a string - * from ZLE). - * If it is 0, comments are not parsed; they are treated as ordinary words. - * If it is 1, comments are treated as single strings, one per line. - * If it is 2, comments are removed. + * flags is passed directly to lexflags, see lex.c, except that |
