Commit graph

108 commits

Author SHA1 Message Date
Peter Stephenson 2afdb3985a 35668: Improved fix for command/proc subst starting in alias.
Use input flag to suppress the unwanted backtracking.

Add test for the extra case covered.
2015-07-02 10:01:42 +01:00
Peter Stephenson dce1f33c02 35667: fix command substitution that starts but doesn't finish in alias 2015-07-01 21:44:50 +01:00
Peter Stephenson 77a0278bcc 35615: fix completion after tyepset 2015-06-26 17:56:44 +01:00
Peter Stephenson 39b28980f3 various posts: Implement assignment parsing for typeset.
Typeset assignments now work like raw assignments except
for no "+=" and no GLOB_ASSIGN.

Documented in typeset builtin doc and mentioned in release notes.

Tests to ensure basic sanity.

Enabled by default, can be turned off by "disable -r" with typeset
family of commands.
2015-06-24 10:21:12 +01:00
Peter Stephenson afb78f5d14 35248: treat fully parenthised zsh patterns as complete case patterns again 2015-05-21 10:25:07 +01:00
Peter Stephenson 52aeb9aaeb 35168: Improve parsing of case patterns.
"|" is now found properly by looking for words that come
from the lexical analyser, rather than hacking a pattern
returned in one dollop.

Update some completion functions that need extra quoting
as a result.

Add test for new parsing.

Update version number to 5.0.8-dev-3 because of wordcode
incompatibility.
2015-05-18 09:56:00 +01:00
Peter Stephenson d52bf91659 35155: cmdpop() could be called erroneously on error 2015-05-15 20:26:08 +01:00
Barton E. Schaefer aa34d2f165 35046: unwind cmdstack when erroring out of lexing a parameter expansion in braces 2015-05-06 07:46:15 -07:00
Peter Stephenson 4508d25710 34905: no parse error after keyboard interrupt.
Handled generally, though only showing up in special nested
cases.

Also fix ZLE so it doesn't cancel the interrupt flag when
not actually returning from a local keymap.
2015-04-17 10:23:58 +01:00
Peter Stephenson f1c702f2a4 34817: Catch some errors earlier when reading history.
Mostly for the case of an interrupt.

Don't try to process words when we know something's gone wrong.

Also abort history reading earlier on an interrupt.
2015-03-29 19:47:01 +01:00
Barton E. Schaefer 81ba837972 34781: add implicit space after alias expansion of tokens that form words without spacing
fixes crash when using completion immediately following such an alias
2015-03-28 21:24:27 -07:00
Barton E. Schaefer 7d2b53f65b 34804: refine POSIX_ALIAS change to preserve old behavior of [[ ]] conditionals 2015-03-28 21:08:02 -07:00
Barton E. Schaefer ab4065623a 34788: refine errflag handling in cmd_or_math() 2015-03-27 11:54:55 -07:00
Peter Stephenson f6be7bc19f 34759: improve implementation of last commit 2015-03-22 19:21:10 +00:00
Peter Stephenson 4fb669a72d 34758: fix yet more history / command subst interaction.
In general we need to wind back over the history text input
inside command substitution because there's no level of
the input mechanism between history and the lexer.
2015-03-22 18:44:56 +00:00
Barton E. Schaefer 32b4cb0e73 34734: further aliasing adjustments and doc
restrict token aliasing (34641) to global aliases; tighten up POSIX_ALIASES to better match spec; update Aliasing doc to cover this and clarify older behavior

2015-03-18  Peter Stephenson  <p.stephenson@samsung.com>

	* 34723: configure.ac: turn off fixed site function directory if
2015-03-18 18:01:54 -07:00
Peter Stephenson 506eaa0a63 34651: Avoid core dump if no lexical token 2015-03-05 10:02:38 +00:00
Peter Stephenson 0ac87e3f59 34641: make it possible to alias tokens 2015-03-04 15:56:17 +00:00
Peter Stephenson 52e938bac9 34570: Another nasty command / math substituion thing.
Mark arithmetic substitutions with tokens to make sure the substitution
go knows what to do.  Before it was guessing by counting the
parentheses at the end.
2015-02-19 10:22:40 +00:00
Peter Stephenson 126fb61c7c 34560: Fix $(( that's actually a multiline cmd subst. 2015-02-16 17:16:57 +00:00
Barton E. Schaefer 2c13d9fb0d 34543: Prevent crash on garbage bytes inside $(...)
Garbage input (nul bytes, etc.) can cause the $(...) parser to become
confused during look-ahead and attempt to back up the input too far.
This commit catches the error but does not fix the underlying cause.
2015-02-14 10:43:10 -08:00
Peter Stephenson c6c9f5daf2 34322: bug with interface to parsestr() etc.
Was showing up in places like ${(e)...} where command substitution
could reallocate the token string, but actually there was never any
guarantee that the lexer wouldn't do that, so this was always
a bit iffy.
2015-01-18 22:38:57 +00:00
Peter Stephenson e34ce85151 34319: fix alias expansion in history for command substitution 2015-01-18 16:43:26 +00:00
Peter Stephenson f2a2f28f7b 32413: turn off history word marking in cmd subst 2015-01-16 20:12:40 +00:00
Peter Stephenson db05cc51fa 34304: improve use of new cmd subst in completion 2015-01-16 13:20:05 +00:00
Peter Stephenson 968dd7387c 34234: use structures for normal and raw lexical buffer state 2015-01-11 19:12:58 +00:00
Peter Stephenson cfd91eac07 Rearrange context saving.
Variables are now associated with the module that declares them, being
initialised and saved/restored there.  However, as many variables are
used for communication between modules, many of them are set in multiple
places, so the assignment is ambiguous.
2015-01-09 21:33:39 +00:00
Peter Stephenson c0d01a6fe0 Fix command substitutions to parse contents as they are read in.
Do this by refactoring misnamed lexsave()/lexrestore() to allow
continuity of history and input.

Add test.
2015-01-08 12:24:00 +00:00
Peter Stephenson d067ebcacd 33876: etc.: Separate errors and keyboards interrupts
Combination of 12 commits from interrupt_abort branch.

Basic strategy is to introduce bits to errflag and to set and
reset them separately.

Remove interrupt status on return to main keymap.

Turn off ERRFLAG_INT for always block.

Restore bit thereafter: we probably need a new variable in order
to allow user interrupts to be reset in the always block.

Add TRY_BLOCK_INTERRUPT

This works the same as TRY_BLOCK_ERROR, but for a SIGINT, too.

Ensure propagation of SIGINT from exited job.

If received by foreground job, shell uses ERRFLAG_INT, not
ERRFLAG_ERROR, to set the new state.

Reset errflag before precmd()

Add always block in _main_completion to fix ZLS_COLORS

Ensures we get the right state of $ZLS_COLORS at the end of _main_complete
even if there's an interrupt.  However, the "right state" is a bit messy
as it depends on styles.
2014-12-11 09:41:17 +00:00
Jun-ichi Takimoto 45d0046d8f 33940: handle backslash-meta correctly in lexer 2014-12-10 08:20:40 +09:00
Barton E. Schaefer 8727049674 33298: make lexrestore() more signal-safe 2014-09-30 20:34:58 -07:00
Peter Stephenson 920db696cb 32789: --enable-zsh-valgrind allows analysis of heap allocation 2014-06-24 18:50:50 +01:00
Peter Stephenson 31c5c7bb11 unposted: fix previous commit: ihwend -> hwend 2013-07-22 21:00:50 +01:00
Peter Stephenson 6533ae0719 31559: Fix history line problem with aliases and comments 2013-07-22 20:58:57 +01:00
Peter Stephenson 64e925bd65 30783: We don't want leading "="s to be active when
tokenising strings that aren't going to be treated as command line
arguments
2012-11-08 12:28:11 +00:00
Peter Stephenson eb562c9f2c 30715: use enum lextok for variables containing lexical tokens 2012-10-05 21:35:05 +00:00
Peter Stephenson 61b9529ff8 users/17310: we can't treat < after [ as a normal character.
Document problem and test for case that needs to work.
2012-10-03 18:11:12 +00:00
Peter Stephenson 76590bd93c users/17304: angle brackets aren't associated with special parsing
inside square brackets
2012-10-02 12:46:45 +00:00
Peter Stephenson e3182c18de 29955++: IGNORE_CLOSE_BRACES option 2011-12-08 19:42:07 +00:00
Peter Stephenson 724fd07a67 29934: Stef van Vlierberghe: uninitialised memory after lexer realloc 2011-12-03 17:24:45 +00:00
Peter Stephenson 3dba9a8614 29776: fix case of double quotes in double-quote-style
parsing where end character is something else
2011-09-15 14:04:51 +00:00
Peter Stephenson 962624e8c3 29491: remove some variables set but not used 2011-06-19 16:26:10 +00:00
Mikael Magnusson 72cb7cfc6f 29307, 29308 + replies: Fix some doubled words in docs and comments. 2011-05-19 16:10:46 +00:00
Peter Stephenson 655370ff3c 28799: lexical analyser didn't stop early enough with completion words 2011-02-24 13:48:47 +00:00
Peter Stephenson 73ebca4fe9 28783: allow parentheses to be special in more places with SH_GLOB 2011-02-21 11:32:47 +00:00
Peter Stephenson c8d07027c8 28537: fix word splitting on "((" when it was nested subshells rather than
arithmetic
2010-12-19 17:42:09 +00:00
Peter Stephenson ef5cf45780 unposted: another neatening of lexflags use in ZLE 2010-12-14 10:40:42 +00:00
Peter Stephenson ebcead7543 lexsave/lexrestore lexflags
add new LEXFLAGS_ZLE
2010-12-14 10:35:38 +00:00
Peter Stephenson eab4f9a83c 28528: Rearrange zleparse to lexflags
Add (z+n+)
2010-12-14 09:59:04 +00:00
Peter Stephenson 5858e79f4d 28526: remove bogus newline with stripped comment zplitting 2010-12-13 11:20:46 +00:00