From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QOswL-00084J-46 for garchives@archives.gentoo.org; Tue, 24 May 2011 14:50:33 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7C4841C1CE; Tue, 24 May 2011 14:50:14 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 3CF091C1CE for ; Tue, 24 May 2011 14:50:14 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id AC8221BC01B for ; Tue, 24 May 2011 14:50:13 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 07E8D80505 for ; Tue, 24 May 2011 14:50:13 +0000 (UTC) From: "Petteri Räty" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Petteri Räty" Message-ID: Subject: [gentoo-commits] proj/libbash:master commit in: / X-VCS-Repository: proj/libbash X-VCS-Committer: betelgeuse X-VCS-Committer-Name: Petteri Räty X-VCS-Revision: dd5cbd758e004e0ae07914a6e03484b3414322b4 Date: Tue, 24 May 2011 14:50:13 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 91a3f7931423928d060b00b22bff2f1f commit: dd5cbd758e004e0ae07914a6e03484b3414322b4 Author: Petteri R=C3=A4ty petteriraty eu> AuthorDate: Tue May 24 14:47:04 2011 +0000 Commit: Petteri R=C3=A4ty gentoo org> CommitDate: Tue May 24 14:47:04 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/libbash.git;a= =3Dcommit;h=3Ddd5cbd75 Merge remote-tracking branch 'mu/declare_builtin' into review Conflicts: scripts/command_execution.bash scripts/command_execution.bash.result scripts/function_def.bash scripts/function_def.bash.result Makefile.am | 3 + bashast/libbashWalker.g | 24 ++++++- scripts/command_execution.bash | 2 + scripts/command_execution.bash.result | 1 + scripts/function_def.bash | 13 ++++ scripts/function_def.bash.result | 1 + src/builtins/declare_builtin.cpp | 66 ++++++++++++++= ++++++ .../{source_builtin.h =3D> declare_builtin.h} | 32 +++++----- src/builtins/tests/declare_tests.cpp | 66 ++++++++++++++= ++++++ src/cppbash_builtin.cpp | 2 + 10 files changed, 191 insertions(+), 19 deletions(-) diff --cc Makefile.am index bd0bf7b,c8c702b..c4605cd --- a/Makefile.am +++ b/Makefile.am @@@ -97,8 -97,8 +97,9 @@@ cppunittests_SOURCES =3D test/run_tests. src/core/tests/symbols_test.cpp \ src/core/tests/interpreter_test.cpp \ src/core/tests/bash_ast_test.cpp \ + src/core/tests/bash_condition_test.cpp \ src/builtins/tests/echo_tests.cpp \ + src/builtins/tests/declare_tests.cpp \ src/builtins/tests/boolean_tests.cpp \ src/builtins/tests/source_tests.cpp \ src/builtins/tests/return_tests.cpp \ diff --cc scripts/command_execution.bash index 6e655e4,344618e..95e1594 --- a/scripts/command_execution.bash +++ b/scripts/command_execution.bash @@@ -15,5 -16,4 +16,6 @@@ true || echo "wrong echo "end" : ${DEFAULTED:=3D"yes"} FOO=3D"abc" echo "command environment" +export FOO003=3D1 FOO004=3Dabc FOO005=3D(1 2 3) FOO002 +abc=3D1 export foo + true > /dev/null diff --cc scripts/command_execution.bash.result index 9f2ba11,bd09a8b..ae71fa5 --- a/scripts/command_execution.bash.result +++ b/scripts/command_execution.bash.result @@@ -4,7 -4,7 +4,8 @@@ righ right end command environment +We do not support command env before the export builtin. + Redirection is not supported yet DEFAULTED=3Dyes FOO001=3Dhello FOO002=3DHello World diff --cc scripts/function_def.bash index ac99f83,101e732..5be1e36 --- a/scripts/function_def.bash +++ b/scripts/function_def.bash @@@ -52,15 -52,15 +52,28 @@@ func_nested2()=20 func_nested1 } func_nested2 +=20 +let() { + echo "overloaded let" +} +let "1 + 2" +func_positional_args() { + IFS=3D"abc" echo "$*" + IFS=3D"abc" echo $* + IFS=3Dabc + echo "$*" + echo $* +} +func_positional_args 1 2 3 ++ + if true; then + function_in_compound_statement() { + echo "function_in_compound_statement" + } + fi + if false; then + function_in_compound_statement() { + echo "I should not get called" + } + fi + function_in_compound_statement diff --cc scripts/function_def.bash.result index e4cdd82,a1c9b91..d3abad0 --- a/scripts/function_def.bash.result +++ b/scripts/function_def.bash.result @@@ -1,9 -1,5 +1,10 @@@ hi 1 +overloaded let +1 2 3 +1 2 3 +1a2a3 +1 2 3 + function_in_compound_statement ARG1=3D100 ARG2=3D2 ARG3=3D3 diff --cc src/cppbash_builtin.cpp index 7334a8e,edbfa8c..88fdf99 --- a/src/cppbash_builtin.cpp +++ b/src/cppbash_builtin.cpp @@@ -25,9 -25,9 +25,10 @@@ #include "cppbash_builtin.h" =20 #include "builtins/boolean_builtins.h" + #include "builtins/declare_builtin.h" #include "builtins/echo_builtin.h" #include "builtins/inherit_builtin.h" +#include "builtins/let_builtin.h" #include "builtins/return_builtin.h" #include "builtins/source_builtin.h" =20