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 1QVJUl-0005JN-04 for garchives@archives.gentoo.org; Sat, 11 Jun 2011 08:24:39 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 43AE91C007; Sat, 11 Jun 2011 08:24:29 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 1553C1C007 for ; Sat, 11 Jun 2011 08:24:29 +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 998D81B4031 for ; Sat, 11 Jun 2011 08:24:28 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id EE89D8003C for ; Sat, 11 Jun 2011 08:24:27 +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: 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: bb8cda9be17650ba4006fca9bae3274a4e55a809 Date: Sat, 11 Jun 2011 08:24:27 +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: 34eb18fc0ead5649f45a2dfd52962c90 commit: bb8cda9be17650ba4006fca9bae3274a4e55a809 Author: Petteri R=C3=A4ty petteriraty eu> AuthorDate: Thu Jun 9 14:14:33 2011 +0000 Commit: Petteri R=C3=A4ty gentoo org> CommitDate: Fri Jun 10 14:44:01 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/libbash.git;a= =3Dcommit;h=3Dbb8cda9b Parser: handle appending to arrays The parser couldn't handle array+=3D(a b c) syntax. --- bashast/bashast.g | 7 ++++--- bashast/gunit/array.gunit | 3 +++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/bashast/bashast.g b/bashast/bashast.g index af5cfcf..a8d44d5 100644 --- a/bashast/bashast.g +++ b/bashast/bashast.g @@ -244,13 +244,14 @@ cond_comparison var_def : name LSQUARE BLANK? explicit_arithmetic BLANK* RSQUARE EQUALS fname? = -> ^(EQUALS ^(name explicit_arithmetic) fname?) | name EQUALS^ value? + | name PLUS_ASSIGN array_value -> ^(PLUS_ASSIGN name array_value) | name PLUS_ASSIGN fname_part? -> ^(EQUALS name ^(STRING ^(VAR_REF name= ) fname_part?)); //Possible values of a variable value : fname - | LPAREN! wspace!* arr_val RPAREN!; + | array_value; //allow the parser to create array variables -arr_val : - | (ag+=3Darray_atom wspace*)+ -> ^(ARRAY $ag+); +array_value + : LPAREN wspace* (array_atom wspace*)* RPAREN -> ^(ARRAY array_atom*); array_atom : (LSQUARE) =3D> LSQUARE! BLANK!* explicit_arithmetic BLANK!? RSQUARE! = EQUALS^ fname | fname; diff --git a/bashast/gunit/array.gunit b/bashast/gunit/array.gunit index caa2615..eb11be8 100644 --- a/bashast/gunit/array.gunit +++ b/bashast/gunit/array.gunit @@ -26,6 +26,9 @@ var_def: --disable-dependency-tracking ${VAR} )" -> (=3D asdf (ARRAY (STRING - - disable - dependency - tracking) (STR= ING (VAR_REF VAR)))) +"asdf=3D()" -> (=3D asdf ARRAY) +"asdf+=3D()" -> (+=3D asdf ARRAY) +"asdf+=3D(a)" -> (+=3D asdf (ARRAY (STRING a))) =20 var_ref: "$asdf" -> (VAR_REF asdf)