summaryrefslogtreecommitdiff
path: root/Src/parse.c
AgeCommit message (Collapse)AuthorFilesLines
2018-04-23Allow short loops with "while"Peter Stephenson1-1/+3
2018-03-0542365: Use .zwc file if timestamp identical to source.Martijn Dekker1-4/+4
This can happen if the files are bundled together.
2017-12-1242110: Fix redirections between variable assignments at start of linePeter Stephenson1-0/+4
2017-10-0441802 (minor tweaks): use heap during shell function call.Peter Stephenson1-1/+2
Replaces stack for more efficient memory management. Also fix debug message when FUNCNEST is increased.
2017-09-0441633: Fix problem backgrounding function definitions.Peter Stephenson1-1/+6
Owing to being marked as simple sublists the instruction to background was ignored. This applied to anonymous functions.
2017-08-0941504: make empty strings work in case patterns with no leading parenthesisPeter Stephenson1-10/+38
2017-07-0941402: Delay has_tokens() in ecstrcode as may not be neededSebastian Gniazdowski1-1/+5
2017-07-0941402: Add hasher to ecstrcode to reduce string comparisonsSebastian Gniazdowski1-1/+5
2017-05-0840173: Off-by-one error checking for {varid}.Peter Stephenson1-1/+1
This caused a single unprintable character in braces before a redirection to be treated as an indentifier.
2017-05-08users/22688: Allow mixing redirs and arguments after anon functions.Peter Stephenson1-4/+15
These are parsed differently from the case of normal functions which can't take normal arguments at that point.
2017-05-08Fix combination of HERE document and |&.Peter Stephenson1-1/+1
A missing flag setting up the HERE document mean that the size of the wordcode needed to append the 2>&1 was counted incorrectly, so the resulting wordcode was garbled. Add test.
2017-03-0740760: Always tokenize unquoted - to Dash.Peter Stephenson1-14/+27
This fixes use of pattern match character ranges in unusual contexts. Attempt to detect a tokenized - in cases where we don't care.
2017-01-2940453: signal handler safety for callers of patcompile(PAT_STATIC), which is ↵Barton E. Schaefer1-0/+1
not re-entrant.
2017-01-11Add features associated with autoloading a function using an absolutePeter Stephenson1-9/+15
path. -d defaults to normal fpath -r remembers the path without actually loading. May be combined with -d. -R does the same but it's an error if not found -X can now take a directory path: this is used to output not yet loaded functions that have an associated path.
2017-01-1040306 with doc tweaks: Change behaviour expanding alias in () function ↵Peter Stephenson1-0/+14
definition. Now an error unless the () is part of the same error as the name. Add ALIAS_FUNC_DEF option to allow it again.
2016-10-3039777: $() is a valid empty command substitutionPeter Stephenson1-1/+1
2016-09-1639332: support ksh's [[ -v varname ]] condition for checking if variables ↵Oliver Kiddle1-2/+2
are set
2016-09-15unposted: remove duplicated assignmentOliver Kiddle1-1/+0
2016-09-1339292: Distinguish "=" and "==" tests in output.Peter Stephenson1-2/+7
This is both in xtrace output and shell code rebuilt from internal structures.
2016-03-0738111: Remove redundant return values in parsing.Peter Stephenson1-11/+4
Return values from par_list() and par_list1() are no longer used.
2016-03-0638106: if...then if...else should be a parse error.Barton E. Schaefer1-1/+1
2016-01-2937700: Teach ${(z)} the 'repeat WORD SUBLIST' syntax.Daniel Shahaf1-0/+10
2015-12-3137469: do NOT allow semicolons in place of line breaks in conditionalsBarton E. Schaefer1-14/+16
2015-12-3137468: allow line breaks in more places in [[ ... ]]Barton E. Schaefer1-8/+12
2015-10-2736974: fix some functions with empty argument listsPeter Stephenson1-1/+1
2015-09-1936566: check for regular file before lseek()Barton E. Schaefer1-0/+3
2015-08-21unposted: fix up for 5.0.8-test-2Peter Stephenson1-1/+1
2015-08-2136265 plus FAQ: fix alias expansion after "function"Peter Stephenson1-2/+3
Owing to interesting historical parsing, names after the first were treated as command words so had non-global aliases expanded. Add an FAQ note that use of the function keyword works around other alias problems
2015-08-0936022 fix bug that some loop constructs could not be interrupted, revise ↵Barton E. Schaefer1-0/+8
signal queueing There are two underlying ideas here: (1) Keeping signals queued around anything that's doing memory management (including push/pop of the heap) has become crucial. (2) Anytime the shell is going to run a command, be it buitin or external, it must be both safe and necessary to process any queued signals, so that the apparent order of signal arrival and command execution is preserved.
2015-06-2835643: Redirections after typeset assignments were broken.Peter Stephenson1-0/+2
2015-06-24various posts: Implement assignment parsing for typeset.Peter Stephenson1-21/+110
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-05-2735306: "test -z \(" failed due to parse confusionPeter Stephenson1-8/+17
2015-05-2135250: Fix case documentation (SH_GLOB)Peter Stephenson1-2/+2
2015-05-2135248: treat fully parenthised zsh patterns as complete case patterns againPeter Stephenson1-10/+85
2015-05-1835184: Additional case fix for 35168.Peter Stephenson1-2/+0
Lexical analysis flags got screwed up after a "|", so we didn't parse patterns properly, in particular those with parentheses.
2015-05-1835168: Improve parsing of case patterns.Peter Stephenson1-66/+23
"|" 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-04-1734921: handle error in recursive par_event().Peter Stephenson1-0/+1
Here documents in an interrupted list caused bad juju.
2015-04-1734905: no parse error after keyboard interrupt.Peter Stephenson1-1/+1
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-02-1234514: Back out 34485, an alternate solution needs to be worked out.Barton E. Schaefer1-2/+4
(Tweaked to keep the unrelated hunk of the E01 test.)
2015-02-0934485: More rationalisation for anonymous functions.Peter Stephenson1-4/+2
Don't attempt to treat as "simple" case as there are too many hidden problems. Pull out some post-execution functions to a common case in execcmd().
2015-01-09Rearrange context saving.Peter Stephenson1-3/+80
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-08Fix command substitutions to parse contents as they are read in.Peter Stephenson1-9/+20
Do this by refactoring misnamed lexsave()/lexrestore() to allow continuity of history and input. Add test.
2014-12-1133876: etc.: Separate errors and keyboards interruptsPeter Stephenson1-15/+16
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-11-28unposted: fix compiler set-but-not-used warning.Wayne Davison1-2/+4
2014-10-0333346: another bit of the 33345 repairBart Schaefer1-1/+2
2014-10-0333345: fix anonymous function complex command handling.Peter Stephenson1-83/+84
Longstanding problem caused simple anonymous function incorrectly to reset the overall "complext" state, causing wordcode to be diverted into execsimple(), which caused a crash 'cos ist wasn't simple.
2014-10-03unposted: comments in previous commit were reversedPeter Stephenson1-4/+4
2014-10-0333343: Variant anonymous function synax with arguments.Peter Stephenson1-7/+24
Don't expand arguments as if in command position. Test.
2014-09-2933285: apply function definition redirections at executionPeter Stephenson1-9/+78
2014-09-2633242: tokens following if, for, repeat, while aren't in command positionPeter Stephenson1-2/+14