aboutsummaryrefslogtreecommitdiff
blob: 2799fa23d3edcb2671af31ee653237c1871726e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
gunit bashast;

function:
"function quit {
	exit
}" -> (function (STRING quit) (CURRSHELL (LIST (COMMAND (STRING exit)))))

"function quit{ exit; }" FAIL
"function quit { exit }" FAIL
"function quit { exit; }" -> (function (STRING quit) (CURRSHELL (LIST (COMMAND (STRING exit)))))
"function foo() { :; }" -> (function (STRING foo) (CURRSHELL (LIST (COMMAND (STRING :)))))
"foo() { :; }" -> (function (STRING foo) (CURRSHELL (LIST (COMMAND (STRING :)))))

"function quit { exit; } > /dev/null" -> (function (STRING quit) (CURRSHELL (LIST (COMMAND (STRING exit)))) (REDIR > (STRING / dev / null)))
"function help { echo hi; } 2> /dev/null" -> (function (STRING help) (CURRSHELL (LIST (COMMAND (STRING echo) (STRING hi)))) (REDIR 2 > (STRING / dev / null)))
"function help { echo 3; } 2> /dev/null > output" OK