Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id DBE6B200BBD for ; Tue, 8 Nov 2016 17:08:23 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id DA4F2160B0A; Tue, 8 Nov 2016 16:08:23 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 544EA160AD0 for ; Tue, 8 Nov 2016 17:08:23 +0100 (CET) Received: (qmail 98810 invoked by uid 500); 8 Nov 2016 16:08:22 -0000 Mailing-List: contact dev-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@groovy.apache.org Delivered-To: mailing list dev@groovy.apache.org Received: (qmail 98800 invoked by uid 99); 8 Nov 2016 16:08:22 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Nov 2016 16:08:22 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id BD508183994 for ; Tue, 8 Nov 2016 16:08:21 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.473 X-Spam-Level: *** X-Spam-Status: No, score=3.473 tagged_above=-999 required=6.31 tests=[FORGED_HOTMAIL_RCVD2=1.187, RCVD_IN_DNSWL_NONE=-0.0001, SPF_SOFTFAIL=0.972, URIBL_BLOCKED=0.001, URI_HEX=1.313] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id D_kGkaESkCNZ for ; Tue, 8 Nov 2016 16:08:19 +0000 (UTC) Received: from mbob.nabble.com (mbob.nabble.com [162.253.133.15]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 8E7135F202 for ; Tue, 8 Nov 2016 16:08:19 +0000 (UTC) Received: from static.162.255.23.22.macminivault.com (unknown [162.255.23.22]) by mbob.nabble.com (Postfix) with ESMTP id B4A583589119 for ; Tue, 8 Nov 2016 07:59:17 -0800 (PST) Date: Tue, 8 Nov 2016 09:08:18 -0700 (MST) From: Daniel Sun To: dev@groovy.incubator.apache.org Message-ID: <1478621298812-5736558.post@n5.nabble.com> Subject: Safe index for Groovy 3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit archived-at: Tue, 08 Nov 2016 16:08:24 -0000 Hi all, The new parser supports safe index now, which is proposed by Paul King :) Here are some example code: assert null == null?[1]; assert null == null?[1]?[1, 2]; assert null == null?[1]?[1, 2]?[1, 2, 3]; def a = null; assert null == a?[1, 2]; def f() {return null} assert null == f()?[1]; More information can be found at the safeIndex branch of groovy-parser project(https://github.com/danielsun1106/groovy-parser/tree/safeIndex) Any thoughts? BTW, the antlr4 branch of apache/groovy is very old, I am going to try to update it with the master. Cheers, Daniel.Sun -- View this message in context: http://groovy.329449.n5.nabble.com/Safe-index-for-Groovy-3-tp5736558.html Sent from the Groovy Dev mailing list archive at Nabble.com.