2014-12-24 07:46:47 +08:00
|
|
|
Test1
|
|
|
|
|
|
|
|
begin
|
|
|
|
echo hi
|
|
|
|
|
|
|
|
|
|
|
|
end | cat | cat | begin
|
|
|
|
echo hi
|
|
|
|
end | begin
|
|
|
|
begin
|
|
|
|
echo hi
|
|
|
|
end
|
|
|
|
end arg
|
|
|
|
|
|
|
|
Test2
|
|
|
|
|
|
|
|
switch aloha
|
|
|
|
|
|
|
|
case alpha
|
|
|
|
echo sup
|
|
|
|
|
|
|
|
case beta gamma
|
|
|
|
echo hi
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
Test3
|
|
|
|
|
|
|
|
function hello_world
|
|
|
|
|
|
|
|
begin
|
|
|
|
echo hi
|
|
|
|
end | cat
|
|
|
|
|
|
|
|
echo sup
|
|
|
|
echo sup
|
|
|
|
echo hello
|
|
|
|
|
|
|
|
echo hello
|
|
|
|
end
|
|
|
|
|
|
|
|
Test4
|
|
|
|
|
|
|
|
echo alpha #comment1
|
|
|
|
#comment2
|
|
|
|
|
|
|
|
#comment3
|
|
|
|
for i in abc #comment1
|
|
|
|
#comment2
|
|
|
|
echo hi
|
|
|
|
end
|
|
|
|
|
|
|
|
switch foo #abc
|
|
|
|
# bar
|
|
|
|
case bar
|
|
|
|
echo baz\
|
|
|
|
qqq
|
|
|
|
case "*"
|
|
|
|
echo sup
|
|
|
|
end
|
|
|
|
Test5
|
|
|
|
|
|
|
|
if true
|
|
|
|
else if false
|
|
|
|
echo alpha
|
|
|
|
switch beta
|
|
|
|
case gamma
|
|
|
|
echo delta
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
Test6
|
|
|
|
|
|
|
|
begin
|
|
|
|
echo hi
|
|
|
|
else
|
|
|
|
echo bye
|
|
|
|
end
|
|
|
|
echo alpha "
|
2014-12-24 08:30:39 +08:00
|
|
|
|
|
|
|
Test7
|
|
|
|
|
|
|
|
if begin
|
|
|
|
false
|
|
|
|
end
|
|
|
|
echo hi
|
|
|
|
end
|
|
|
|
while begin
|
|
|
|
false
|
|
|
|
end
|
|
|
|
echo hi
|
|
|
|
end
|
2016-04-06 06:43:24 +08:00
|
|
|
|
|
|
|
Test redir formatting
|
|
|
|
|
|
|
|
echo <stdin >>appended yes 2>&1 no >stdout maybe 2>&4 | cat 2>| cat
|
2016-04-10 09:56:13 +08:00
|
|
|
|
|
|
|
Test normalization of keywords
|
|
|
|
|
|
|
|
if true
|
|
|
|
echo yes
|
|
|
|
end
|
|
|
|
|
|
|
|
while true
|
|
|
|
builtin yes
|
|
|
|
end
|
2018-05-08 06:52:04 +08:00
|
|
|
|
|
|
|
alpha | \
|
|
|
|
beta
|
|
|
|
|
|
|
|
gamma | \
|
|
|
|
# comment3
|
|
|
|
delta
|
|
|
|
|
|
|
|
if true
|
|
|
|
echo abc
|
|
|
|
end
|
|
|
|
|
|
|
|
if false # comment4
|
|
|
|
and true && false
|
|
|
|
echo abc
|
|
|
|
end
|
|
|
|
|
|
|
|
echo hi |
|
|
|
|
|
|
|
|
echo bye
|
2019-05-04 01:00:55 +08:00
|
|
|
a
|
|
|
|
echo
|
|
|
|
echo
|
2019-05-05 18:51:49 +08:00
|
|
|
a; and b
|
|
|
|
a
|
|
|
|
and b
|
|
|
|
a
|
|
|
|
and b
|
|
|
|
a
|
|
|
|
b
|