/* Please use git log for copyright holder and year information This file is part of libbash. libbash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. libbash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with libbash. If not, see . */ gunit java_libbash; command_atom: "function quit { exit }" -> (FUNCTION (STRING quit) (CURRENT_SHELL (LIST (COMMAND (STRING exit))))) "function quit{ exit; }" FAIL "function quit { exit }" FAIL "function quit { exit; }" -> (FUNCTION (STRING quit) (CURRENT_SHELL (LIST (COMMAND (STRING exit))))) "function foo() { :; }" -> (FUNCTION (STRING foo) (CURRENT_SHELL (LIST (COMMAND (STRING :))))) "function foo(){ :; }" -> (FUNCTION (STRING foo) (CURRENT_SHELL (LIST (COMMAND (STRING :))))) "foo() { :; }" -> (FUNCTION (STRING foo) (CURRENT_SHELL (LIST (COMMAND (STRING :))))) "foo(){ :; }" -> (FUNCTION (STRING foo) (CURRENT_SHELL (LIST (COMMAND (STRING :))))) "xorg-2_reconf_source() { :; }" -> (FUNCTION (STRING xorg - 2 _reconf_source) (CURRENT_SHELL (LIST (COMMAND (STRING :))))) "function out() { function inner() { :; }; }" -> (FUNCTION (STRING out) (CURRENT_SHELL (LIST (COMMAND (FUNCTION (STRING inner) (CURRENT_SHELL (LIST (COMMAND (STRING :))))))))) command: "function quit { exit; } > /dev/null" -> (COMMAND (REDIR > (STRING / dev / null)) (FUNCTION (STRING quit) (CURRENT_SHELL (LIST (COMMAND (STRING exit)))))) "function quit { # comment exit; } > /dev/null" -> (COMMAND (REDIR > (STRING / dev / null)) (FUNCTION (STRING quit) (CURRENT_SHELL (LIST (COMMAND (STRING exit)))))) "function help { echo hi; } 2> /dev/null" -> (COMMAND (REDIR 2 > (STRING / dev / null)) (FUNCTION (STRING help) (CURRENT_SHELL (LIST (COMMAND (STRING echo) (STRING hi)))))) "function help { echo 3; } 2> /dev/null > output" OK