Return-Path: Delivered-To: apmail-commons-dev-archive@www.apache.org Received: (qmail 15653 invoked from network); 7 Jan 2010 18:58:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 7 Jan 2010 18:58:08 -0000 Received: (qmail 24796 invoked by uid 500); 7 Jan 2010 18:58:07 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 24670 invoked by uid 500); 7 Jan 2010 18:58:07 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 24659 invoked by uid 99); 7 Jan 2010 18:58:07 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Jan 2010 18:58:07 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of sebbaz@gmail.com designates 209.85.218.224 as permitted sender) Received: from [209.85.218.224] (HELO mail-bw0-f224.google.com) (209.85.218.224) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Jan 2010 18:57:59 +0000 Received: by bwz24 with SMTP id 24so12463573bwz.10 for ; Thu, 07 Jan 2010 10:57:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=6xBEzdW2bk3qjGGxiDzG9jf9vNXNaYtJiZAX7xNJ6Io=; b=jqZrzZYtGJ0IMQ/meH70732CbaJY9IoPDzPOEq2o5scc2+cjeUEcKpm0P6PubmhchQ Doa/+nCWpu+dDkpCR7yX7ni09BWW3PsYaOuTHgpQmpdIfDS7b2Vjwo5755TS3ZI3Dodn pWw3gm/P8IeYkrkHyHsYtuEQjmJ/4hyoealZU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=WGKgDVfG1cRTZOtZfOYbpDCG9Hp8MVLvg0R3bbITEOjMbwXlcAdIG+OZx3zFT5KbBD k3dfGPh+O3suJ0rSiw1Xrc1+PhvxvJjcCySen8TYHeQgq3jpqtMrK5JdIeu+3beglN/v ViH/XMJbnA7teeW6ZrCgUjTMSdy/+HTcYi5cY= MIME-Version: 1.0 Received: by 10.204.155.76 with SMTP id r12mr1649533bkw.175.1262890658825; Thu, 07 Jan 2010 10:57:38 -0800 (PST) In-Reply-To: <20100107180009.6D36823888EC@eris.apache.org> References: <20100107180009.6D36823888EC@eris.apache.org> Date: Thu, 7 Jan 2010 18:57:38 +0000 Message-ID: <25aac9fc1001071057qba4cca0yffae6067a2bfe093@mail.gmail.com> Subject: Re: svn commit: r896944 - in /commons/proper/jexl/trunk/src: main/java/org/apache/commons/jexl2/ main/java/org/apache/commons/jexl2/parser/ test/java/org/apache/commons/jexl2/ From: sebb To: dev@commons.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org On 07/01/2010, henrib@apache.org wrote: > Author: henrib > Date: Thu Jan 7 18:00:07 2010 > New Revision: 896944 > > URL: http://svn.apache.org/viewvc?rev=896944&view=rev > Log: > JEXL-46; adding Perl-like regular-expression operators (=~ and !~) [...] > /** {@inheritDoc} */ > + public Object visit(ASTERNode node, Object data) { > + Object left = node.jjtGetChild(0).jjtAccept(this, data); > + Object right = node.jjtGetChild(1).jjtAccept(this, data); > + try { > + return arithmetic.matches(left, right) ? Boolean.TRUE : Boolean.FALSE; or could use Boolean.valueOf(arithmetic.matches(left, right)); > + } catch (RuntimeException xrt) { > + throw new JexlException(node, ">= error", xrt); s/>=/=~/ > + } > + } > + > + /** {@inheritDoc} */ > public Object visit(ASTIdentifier node, Object data) { > String name = node.image; > if (data == null) { > @@ -972,6 +985,17 @@ > } > > /** {@inheritDoc} */ > + public Object visit(ASTNRNode node, Object data) { > + Object left = node.jjtGetChild(0).jjtAccept(this, data); > + Object right = node.jjtGetChild(1).jjtAccept(this, data); > + try { > + return arithmetic.matches(left, right) ? Boolean.FALSE : Boolean.TRUE; > + } catch (RuntimeException xrt) { > + throw new JexlException(node, ">= error", xrt); s/>=/!~/ > + } > + } > + > + /** {@inheritDoc} */ > public Object visit(ASTNotNode node, Object data) { > Object val = node.jjtGetChild(0).jjtAccept(this, data); > return arithmetic.toBoolean(val) ? Boolean.FALSE : Boolean.TRUE; --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org