Execute the conditions of if and while statements outside of their block

Variables set in if and while conditions are in the enclosing block, not
the if/while statement block. For example:

    if set -l var (somecommand) ; end
    echo $var

will now work as expected.

Fixes #4820. Fixes #1212.
This commit is contained in:
ridiculousfish
2018-03-31 14:57:24 -07:00
parent ba06a89923
commit 4b079e16e5
9 changed files with 90 additions and 36 deletions

View File

@@ -20,3 +20,6 @@ $argle bargle: invalid var name
####################
# Exporting works
####################
# if/for/while scope