From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id BEA501381FD for ; Sun, 29 Jul 2012 12:46:15 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 54A66E05EF; Sun, 29 Jul 2012 12:46:03 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 2ABD6E05EF for ; Sun, 29 Jul 2012 12:46:03 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 941541B4008 for ; Sun, 29 Jul 2012 12:46:02 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 103FFE5441 for ; Sun, 29 Jul 2012 12:46:00 +0000 (UTC) From: "Petteri Räty" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Petteri Räty" Message-ID: <1342747222.1c01ffc3d49a910445c86b76999cd62531ab3e91.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 X-VCS-Directories: scripts/ bashast/ X-VCS-Committer: betelgeuse X-VCS-Committer-Name: Petteri Räty X-VCS-Revision: 1c01ffc3d49a910445c86b76999cd62531ab3e91 X-VCS-Branch: master Date: Sun, 29 Jul 2012 12:46:00 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 1d59d081-2749-4437-a75f-a252dea771cd X-Archives-Hash: b1d0a5ce52cd3c8bf0da70a8a063f2dc commit: 1c01ffc3d49a910445c86b76999cd62531ab3e91 Author: André Aparício gmail com> AuthorDate: Mon Jul 16 20:38:28 2012 +0000 Commit: Petteri Räty gentoo org> CommitDate: Fri Jul 20 01:20:22 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=1c01ffc3 Walker: Support local declaration inside eval --- bashast/libbashWalker.g | 2 +- scripts/var_def.bash | 3 +++ 2 files changed, 4 insertions(+), 1 deletions(-) diff --git a/bashast/libbashWalker.g b/bashast/libbashWalker.g index 42a8917..44cb4c2 100644 --- a/bashast/libbashWalker.g +++ b/bashast/libbashWalker.g @@ -650,7 +650,7 @@ execute_command[std::string& name, std::vector& libbash_args] bool redirection = false; } @init { - if(name != "local" && name != "set" && name != "declare") + if(name != "local" && name != "set" && name != "declare" && name != "eval") current_scope.reset(new interpreter::local_scope(*walker)); } :var_def[true]* (redirect[out, err, in]{ redirection = true; })* { diff --git a/scripts/var_def.bash b/scripts/var_def.bash index b0224f1..fb6550d 100644 --- a/scripts/var_def.bash +++ b/scripts/var_def.bash @@ -85,12 +85,15 @@ echo $FOO005 function foo() { local -i foo=1 local -a bar=(1 2 3) + eval local foobar=23 echo $foo echo ${bar[@]} + echo foobar } foo bar=@ echo $bar +echo $foobar ARRAY11=(1 2 3 [10]=15) ARRAY11+=(1 [15]=20) echo ${ARRAY11[@]}