mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:37:34 +00:00
Shell: Allow newlines between else
and if
's closing brace
This is more flexible and intuitive. Fixes #4992.
This commit is contained in:
parent
a6917465d7
commit
5b79d0d1a3
2 changed files with 15 additions and 3 deletions
|
@ -16,6 +16,14 @@ if test 1 -eq 1 {
|
|||
} else {
|
||||
}
|
||||
|
||||
# Can we put `else` on a new line?
|
||||
if false {
|
||||
echo "if false runs true branch"
|
||||
exit 2
|
||||
}
|
||||
else {
|
||||
}
|
||||
|
||||
# Basic 'if' structure, without 'else'
|
||||
if false {
|
||||
echo "Fail: 'if false' runs the branch"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue