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-368705-garchives=archives.gentoo.org@lists.gentoo.org>) id 1QoyRB-00078e-12 for garchives@archives.gentoo.org; Thu, 04 Aug 2011 13:58:13 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 00CAD21C1DC; Thu, 4 Aug 2011 13:53:40 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id BEA5921C1D3 for <gentoo-commits@lists.gentoo.org>; Thu, 4 Aug 2011 13:53:40 +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 298881B4045 for <gentoo-commits@lists.gentoo.org>; Thu, 4 Aug 2011 13:53:40 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 86F3F8004F for <gentoo-commits@lists.gentoo.org>; Thu, 4 Aug 2011 13:53:39 +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: <2dc5af830837a30b83a74c8ed4e918a3d7c5f3c3.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/arith_main.gunit X-VCS-Directories: bashast/ bashast/gunit/ X-VCS-Committer: betelgeuse X-VCS-Committer-Name: Petteri Räty X-VCS-Revision: 2dc5af830837a30b83a74c8ed4e918a3d7c5f3c3 Date: Thu, 4 Aug 2011 13:53:39 +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: 24d2c7ef5e9cc7cb4840b25fcf3a49f2 commit: 2dc5af830837a30b83a74c8ed4e918a3d7c5f3c3 Author: Mu Qiao <qiaomuf <AT> gentoo <DOT> org> AuthorDate: Thu Jul 21 09:20:13 2011 +0000 Commit: Petteri R=C3=A4ty <betelgeuse <AT> gentoo <DOT> org> CommitDate: Tue Aug 2 07:46:29 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/libbash.git;a= =3Dcommit;h=3D2dc5af83 Parser: support =3D=3D in arithmetic comparison --- bashast/bashast.g | 14 +++++++++++++- bashast/gunit/arith_main.gunit | 1 + 2 files changed, 14 insertions(+), 1 deletions(-) diff --git a/bashast/bashast.g b/bashast/bashast.g index 7bb8a8b..fee25b6 100644 --- a/bashast/bashast.g +++ b/bashast/bashast.g @@ -113,6 +113,7 @@ tokens{ MINUS_SIGN; =20 NOT_EQUALS; + EQUALS_TO; BUILTIN_LOGIC; } =20 @@ -864,7 +865,17 @@ arithmetic ); =20 arithmetic_assignment_operator - : EQUALS|MUL_ASSIGN|DIVIDE_ASSIGN|MOD_ASSIGN|PLUS_ASSIGN|MINUS_ASSIGN|L= SHIFT_ASSIGN|RSHIFT_ASSIGN|AND_ASSIGN|XOR_ASSIGN|OR_ASSIGN; + : {LA(1) =3D=3D EQUALS && LA(2) !=3D EQUALS}? =3D> EQUALS + | MUL_ASSIGN + | DIVIDE_ASSIGN + | MOD_ASSIGN + | PLUS_ASSIGN + | MINUS_ASSIGN + | LSHIFT_ASSIGN + | RSHIFT_ASSIGN + | AND_ASSIGN + | XOR_ASSIGN + | OR_ASSIGN; =20 arithmetic_variable_reference : variable_reference -> ^(VAR_REF variable_reference); @@ -910,6 +921,7 @@ compare_operator | GEQ | LESS_THAN | GREATER_THAN + | EQUALS EQUALS -> EQUALS_TO | BANG EQUALS -> NOT_EQUALS; bitwiseand : compare (AMP^ BLANK!? compare)*; diff --git a/bashast/gunit/arith_main.gunit b/bashast/gunit/arith_main.gu= nit index 1f1a089..5249b5a 100644 --- a/bashast/gunit/arith_main.gunit +++ b/bashast/gunit/arith_main.gunit @@ -80,6 +80,7 @@ arithmetics_test: "17" ->"17" "19<20" -> (< 19 20) "19!=3D20" -> (NOT_EQUALS 19 20) +"19=3D=3D20" -> (EQUALS_TO 19 20) =20 //bitwiseand: "17" -> "17"