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 1Q6N3m-00023f-Fz for garchives@archives.gentoo.org; Sun, 03 Apr 2011 13:09:42 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 211331C019; Sun, 3 Apr 2011 13:09:32 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id CC9141C019 for ; Sun, 3 Apr 2011 13:09:31 +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 B42E61B4044 for ; Sun, 3 Apr 2011 13:09:30 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id DD37180065 for ; Sun, 3 Apr 2011 13:09:29 +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: <0dfd3c9fc0901c078f064f7f738f6974dcabc4c1.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.ebuild scripts/var_def.ebuild.result X-VCS-Directories: scripts/ bashast/ X-VCS-Committer: betelgeuse X-VCS-Committer-Name: Petteri Räty X-VCS-Revision: 0dfd3c9fc0901c078f064f7f738f6974dcabc4c1 Date: Sun, 3 Apr 2011 13:09:29 +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: 16c717827968d27e2ee8b6836dcf2985 commit: 0dfd3c9fc0901c078f064f7f738f6974dcabc4c1 Author: Mu Qiao gentoo org> AuthorDate: Sun Apr 3 10:49:47 2011 +0000 Commit: Petteri R=C3=A4ty gentoo org> CommitDate: Sun Apr 3 10:49:47 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/libbash.git;a= =3Dcommit;h=3D0dfd3c9f Implement variable reference Double quoted string can use variable reference now. --- bashast/libbashWalker.g | 12 +++++++++--- scripts/var_def.ebuild | 2 ++ scripts/var_def.ebuild.result | 2 ++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/bashast/libbashWalker.g b/bashast/libbashWalker.g index c0c8395..fd736c8 100644 --- a/bashast/libbashWalker.g +++ b/bashast/libbashWalker.g @@ -62,9 +62,7 @@ var_def: =20 string_expr returns[std::string libbash_value]: ^(STRING libbash_string=3Dstring_expr) { $libbash_value =3D libbash_str= ing; } - |^(DOUBLE_QUOTED_STRING (dq_str_part { libbash_string +=3D $dq_str_part= .libbash_value; })*) { - $libbash_value =3D libbash_string; - }; + |^(DOUBLE_QUOTED_STRING (libbash_string=3Ddqstr { $libbash_value +=3D l= ibbash_string; })*); =20 //A rule for filenames/strings res_word_str returns[std::string libbash_value] @@ -105,6 +103,14 @@ dq_str_part returns[std::string libbash_value] }: BLANK|EOL|AMP|LOGICAND|LOGICOR|LESS_THAN|GREATER_THAN|PIPE|SQUOTE|SEMIC= |COMMA|LPAREN|RPAREN|LLPAREN|RRPAREN|DOUBLE_SEMIC|LBRACE|RBRACE|TICK|LEQ|= GEQ|str_part_with_pound; =20 +//double quoted string rule, allows expansions +dqstr returns[std::string libbash_value]: + dq_str_part { $libbash_value =3D $dq_str_part.libbash_value; } + | libbash_string=3Dvar_ref { $libbash_value =3D libbash_string; }; + +//variable reference +var_ref returns[std::string libbash_value]: + ^(VAR_REF libbash_name=3Dname) { $libbash_value=3Dwalker->resolve(libbash_name); }; =20 // shell arithmetic arithmetics returns[int value] diff --git a/scripts/var_def.ebuild b/scripts/var_def.ebuild index b5f9a14..73f94b1 100644 --- a/scripts/var_def.ebuild +++ b/scripts/var_def.ebuild @@ -8,3 +8,5 @@ SLOT=3D"0" KEYWORDS=3D"~amd64 ~x86" IUSE=3D"" RDEPEND=3D"dev-db/sqlite:3" +DEPEND=3D"${RDEPEND} + dev-util/pkgconfig" diff --git a/scripts/var_def.ebuild.result b/scripts/var_def.ebuild.resul= t index 750f11b..671ae4c 100644 --- a/scripts/var_def.ebuild.result +++ b/scripts/var_def.ebuild.result @@ -1,3 +1,5 @@ +DEPEND=3Ddev-db/sqlite:3 + dev-util/pkgconfig DESCRIPTION=3DSunPinyin is a SLM (Statistical Language Model) based IME EAPI=3D1 HOMEPAGE=3Dhttp://sunpinyin.googlecode.com