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 <gentoo-commits+bounces-334240-garchives=archives.gentoo.org@lists.gentoo.org>)
	id 1Q8Cee-0001rx-KD
	for garchives@archives.gentoo.org; Fri, 08 Apr 2011 14:27:20 +0000
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 99E661C035;
	Fri,  8 Apr 2011 14:26:33 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	by pigeon.gentoo.org (Postfix) with ESMTP id 699DC1C035
	for <gentoo-commits@lists.gentoo.org>; Fri,  8 Apr 2011 14:26:33 +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 ECB171B4143
	for <gentoo-commits@lists.gentoo.org>; Fri,  8 Apr 2011 14:26:31 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by pelican.gentoo.org (Postfix) with ESMTP id C7A9C80072
	for <gentoo-commits@lists.gentoo.org>; Fri,  8 Apr 2011 14:26:30 +0000 (UTC)
From: "Petteri Räty" <betelgeuse@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Petteri Räty" <betelgeuse@gentoo.org>
Message-ID: <b6dbd318c00436d0c4ba5544bcd7fea4e5ce6879.betelgeuse@gentoo>
Subject: [gentoo-commits] proj/libbash:master commit in: bashast/
X-VCS-Repository: proj/libbash
X-VCS-Files: bashast/bashast.g
X-VCS-Directories: bashast/
X-VCS-Committer: betelgeuse
X-VCS-Committer-Name: Petteri Räty
X-VCS-Revision: b6dbd318c00436d0c4ba5544bcd7fea4e5ce6879
Date: Fri,  8 Apr 2011 14:26:30 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: quoted-printable
X-Archives-Salt: 
X-Archives-Hash: 9f70f1ee9e5cfb59a04e8e3526c32fe6

commit:     b6dbd318c00436d0c4ba5544bcd7fea4e5ce6879
Author:     Petteri R=C3=A4ty <petsku <AT> petteriraty <DOT> eu>
AuthorDate: Fri Apr  8 13:31:40 2011 +0000
Commit:     Petteri R=C3=A4ty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Fri Apr  8 13:31:40 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=3Dproj/libbash.git;a=
=3Dcommit;h=3Db6dbd318

Simplify variable definition blank handling

Moved the blank matching from var_def level to simple_command so it only
needs to be specified once.

---
 bashast/bashast.g |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/bashast/bashast.g b/bashast/bashast.g
index 551ae4e..7f4bed5 100644
--- a/bashast/bashast.g
+++ b/bashast/bashast.g
@@ -105,8 +105,7 @@ command
 	|	simple_command;
 //Simple bash commands
 simple_command
-	:	var_def+ bash_command^ redirect*
-	|	bash_command^ redirect*;
+	:	(var_def BLANK!+)* bash_command^ redirect*;
 bash_command
 	:	fname_no_res_word (BLANK+ arg)* -> ^(COMMAND fname_no_res_word arg*);
 //An argument to a command
@@ -217,9 +216,9 @@ cond_comparison
 	:	cond_expr -> ^(COMPOUND_COND cond_expr);
 //Variables
 //Defining a variable
-var_def	:	BLANK* name LSQUARE BLANK? var_index BLANK* RSQUARE EQUALS val=
ue BLANK* -> ^(EQUALS ^(name  var_index) value)
-	|	BLANK!* name EQUALS^ value BLANK!*
-	|	BLANK!* LET! name EQUALS^ arithmetic BLANK!*;
+var_def	:	name LSQUARE BLANK? var_index BLANK* RSQUARE EQUALS value -> ^=
(EQUALS ^(name  var_index) value)
+	|	name EQUALS^ value
+	|	LET! name EQUALS^ arithmetic;
 //Possible values of a variable
 value	:	num
 	|	var_ref