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 1QVJwG-0000Cn-Ma for garchives@archives.gentoo.org; Sat, 11 Jun 2011 08:53:04 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D64311C126; Sat, 11 Jun 2011 08:52:17 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 968A01C0B6 for ; Sat, 11 Jun 2011 08:52:17 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 1A0F32AC010 for ; Sat, 11 Jun 2011 08:52:17 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 6655480056 for ; Sat, 11 Jun 2011 08:52:15 +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: <9f31ac2104a97e7f12cdc10f27037996041f20c6.betelgeuse@gentoo> Subject: [gentoo-commits] proj/libbash:master commit in: scripts/, bashast/ X-VCS-Repository: proj/libbash X-VCS-Files: bashast/libbashWalker.g scripts/var_def.bash scripts/var_def.bash.result scripts/var_expansion.bash scripts/var_expansion.bash.result X-VCS-Directories: scripts/ bashast/ X-VCS-Committer: betelgeuse X-VCS-Committer-Name: Petteri Räty X-VCS-Revision: 9f31ac2104a97e7f12cdc10f27037996041f20c6 Date: Sat, 11 Jun 2011 08:52:15 +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: 3fae14ac5a8f582652e421d127b25f93 commit: 9f31ac2104a97e7f12cdc10f27037996041f20c6 Author: Mu Qiao gentoo org> AuthorDate: Thu Jun 9 15:21:30 2011 +0000 Commit: Petteri R=C3=A4ty gentoo org> CommitDate: Sat Jun 11 08:51:16 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/libbash.git;a= =3Dcommit;h=3D9f31ac21 Walker: support $# --- bashast/libbashWalker.g | 2 +- scripts/var_def.bash | 1 - scripts/var_def.bash.result | 1 - scripts/var_expansion.bash | 2 ++ scripts/var_expansion.bash.result | 2 ++ 5 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bashast/libbashWalker.g b/bashast/libbashWalker.g index 2648ecb..6cd1ef2 100644 --- a/bashast/libbashWalker.g +++ b/bashast/libbashWalker.g @@ -444,7 +444,7 @@ var_ref [bool double_quoted] returns[std::string libb= ash_value] $libbash_value =3D walker->resolve($var_name.libbash_valu= e, $var_name.index); } |^(VAR_REF libbash_string=3Darray_name) { walker->get_all_elements_IFS_= joined(libbash_string, $libbash_value); } - |^(VAR_REF POUND) { std::cerr << "$# has not been implemented yet" << s= td::endl; } + |^(VAR_REF POUND) { $libbash_value =3D boost::lexical_cast= (walker->get_array_length("*")); } |^(VAR_REF QMARK) { $libbash_value =3D walker->get_status(= ); } |^(VAR_REF MINUS) { std::cerr << "$- has not been implemented yet" << s= td::endl; } |^(VAR_REF BANG) { std::cerr << "$! has not been implemented yet" << st= d::endl; } diff --git a/scripts/var_def.bash b/scripts/var_def.bash index 1980681..0989f9a 100644 --- a/scripts/var_def.bash +++ b/scripts/var_def.bash @@ -35,7 +35,6 @@ ARRAY10=3D"${ARRAY05[*]}" FOO001=3D"networkmanager" FOO002=3D"0.8.2" FOO003=3D${FOO001}-${FOO002} -FOO004=3D$# FOO004=3D$? FOO004=3D$- FOO004=3D$! diff --git a/scripts/var_def.bash.result b/scripts/var_def.bash.result index 5ab9882..b9b415e 100644 --- a/scripts/var_def.bash.result +++ b/scripts/var_def.bash.result @@ -1,4 +1,3 @@ -$# has not been implemented yet $- has not been implemented yet $! has not been implemented yet ARRAY01=3D1 2 3 4 5 diff --git a/scripts/var_expansion.bash b/scripts/var_expansion.bash index 1ac22b4..9f42f19 100644 --- a/scripts/var_expansion.bash +++ b/scripts/var_expansion.bash @@ -98,6 +98,7 @@ function positional_parameter_test(){ FOO094=3D${@: -1} FOO095=3D${@: -2:5} FOO096=3D${@:0} + echo $# } positional_parameter_test 1 2 3 4 5 target=3D"abc*abc" @@ -108,3 +109,4 @@ echo ${target/"*"} ARRAY=3D(1 2 3 4 5) echo ${ARRAY[@]:1} echo ${ARRAY[@]:1:3} +echo $# diff --git a/scripts/var_expansion.bash.result b/scripts/var_expansion.ba= sh.result index 31cca8d..bd83c62 100644 --- a/scripts/var_expansion.bash.result +++ b/scripts/var_expansion.bash.result @@ -1,8 +1,10 @@ +5 =20 abcabc abcabc 2 3 4 5 2 3 4 +0 ARRAY=3D1 2 3 4 5 ARRAY2=3Dhello EAPI=3D3