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 4C3C6200B97 for ; Sun, 9 Oct 2016 11:57:35 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 4AC28160ADA; Sun, 9 Oct 2016 09:57:35 +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 B6D3E160AC3 for ; Sun, 9 Oct 2016 11:57:34 +0200 (CEST) Received: (qmail 57405 invoked by uid 500); 9 Oct 2016 09:57:33 -0000 Mailing-List: contact notifications-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 notifications@groovy.apache.org Received: (qmail 57396 invoked by uid 99); 9 Oct 2016 09:57:33 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Oct 2016 09:57:33 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id BF364E0209; Sun, 9 Oct 2016 09:57:33 +0000 (UTC) From: paulk-asert To: notifications@groovy.apache.org Reply-To: notifications@groovy.apache.org References: In-Reply-To: Subject: [GitHub] groovy pull request #439: WIP Add groovy-macro docs Content-Type: text/plain Message-Id: <20161009095733.BF364E0209@git1-us-west.apache.org> Date: Sun, 9 Oct 2016 09:57:33 +0000 (UTC) archived-at: Sun, 09 Oct 2016 09:57:35 -0000 Github user paulk-asert commented on a diff in the pull request: https://github.com/apache/groovy/pull/439#discussion_r82519042 --- Diff: src/spec/doc/core-metaprogramming.adoc --- @@ -2868,6 +3015,90 @@ The difference is that when you use `assertScript`, the code in the `assertScrip unit test is executed*. That is to say that this time, the `Subject` class will be compiled with debugging active, and the breakpoint is going to be hit. +===== ASTMatcher + +Sometimes you may want to make assertions over AST nodes whether to filter those nodes, or to make sure a given +transformation has built the expected AST node. + +**Filtering nodes** + +For instance if you would like to apply a given transformation only to a specific set of AST nodes, you could +use **ASTMatcher** to filter these nodes. The following example shows how to transform a given expression to +another. Using **ASTMatcher** it looks for a specific expression `1 + 1` and it transforms it to `3`. That's why +I called it the `@Joking` example. --- End diff -- I => we --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---