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 1Sb6pI-0001PC-UL for garchives@archives.gentoo.org; Sun, 03 Jun 2012 09:10:21 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B9562E07E2; Sun, 3 Jun 2012 09:08:42 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 843EFE07E2 for ; Sun, 3 Jun 2012 09:08:42 +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 1FCDB1B402A for ; Sun, 3 Jun 2012 09:08:42 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id C23C4E5440 for ; Sun, 3 Jun 2012 09:08:39 +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: <1330590632.19f82f9686e67da79b9f265f8baf228223d069b4.betelgeuse@gentoo> Subject: [gentoo-commits] proj/libbash:master commit in: bashast/, bashast/gunit/ X-VCS-Repository: proj/libbash X-VCS-Files: bashast/bashast.g bashast/gunit/array.gunit X-VCS-Directories: bashast/ bashast/gunit/ X-VCS-Committer: betelgeuse X-VCS-Committer-Name: Petteri Räty X-VCS-Revision: 19f82f9686e67da79b9f265f8baf228223d069b4 X-VCS-Branch: master Date: Sun, 3 Jun 2012 09:08:39 +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: 2a01526a-fd0e-4005-a86b-3ae6e1cfe44a X-Archives-Hash: 1793deef495f5e7acad77962e1834b8b commit: 19f82f9686e67da79b9f265f8baf228223d069b4 Author: Mu Qiao gentoo org> AuthorDate: Thu Mar 1 08:30:32 2012 +0000 Commit: Petteri R=C3=A4ty gentoo org> CommitDate: Thu Mar 1 08:30:32 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/libbash.git;a= =3Dcommit;h=3D19f82f96 Parser: Allow EOLs in builtin array definition --- bashast/bashast.g | 13 ++++++++++++- bashast/gunit/array.gunit | 12 ++++++++++++ 2 files changed, 24 insertions(+), 1 deletions(-) diff --git a/bashast/bashast.g b/bashast/bashast.g index 73249ef..92f4f92 100644 --- a/bashast/bashast.g +++ b/bashast/bashast.g @@ -461,7 +461,18 @@ array_atom ); =20 builtin_variable_definition_item - : ((~EOL) =3D> expansion_base)+; +scope { + int parens; +} +@init { + $builtin_variable_definition_item::parens =3D 0; +} + : ( + (LPAREN) =3D> LPAREN { ++$builtin_variable_definition_item::parens; } + |(RPAREN) =3D> RPAREN { --$builtin_variable_definition_item::parens; = } + |(~EOL) =3D> expansion_base + | {LA(1) =3D=3D EOL && $builtin_variable_definition_item::parens > 0}= ? =3D> EOL + )+; =20 #ifdef OUTPUT_C builtin_variable_definitions[bool local] diff --git a/bashast/gunit/array.gunit b/bashast/gunit/array.gunit index ddfdfeb..1958836 100644 --- a/bashast/gunit/array.gunit +++ b/bashast/gunit/array.gunit @@ -34,6 +34,18 @@ variable_definition_atom: builtin_variable_definitions: "asdf=3D(a b c d) ade acd=3Dbde" -> (LIST (COMMAND (VARIABLE_DEFINITIONS= (=3D asdf (ARRAY (STRING a) (STRING b) (STRING c) (STRING d))) (EQUALS a= de (STRING (VAR_REF ade))) (=3D acd (STRING bde))))) =20 +builtin_variable_definition_item: +"local cmakeargs=3D( + abc + def + ghi +)" -> "local cmakeargs =3D ( \n abc \n def \n ghi \n )" +"export cmakeargs=3D( + abc + def + ghi +)" -> "export cmakeargs =3D ( \n abc \n def \n ghi \n )= " + variable_reference: "$asdf" -> (VAR_REF asdf) "${asdf[0]:-default}" -> (VAR_REF (USE_DEFAULT_WHEN_UNSET_OR_NULL (asdf = (ARITHMETIC 0)) (STRING default)))