GitHub user bsideup opened a pull request: https://github.com/apache/incubator-groovy/pull/122
MacroGroovy You can merge this pull request into a Git repository by running: $ git pull https://github.com/bsideup/incubator-groovy feature/macro Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-groovy/pull/122.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #122 ---- commit 0b5f0b03d39c10bb7071dd0eedaacc2157cdd6c0 Author: Sergey Egorov <bsid...@gmail.com> Date: 2014-07-02T21:46:13Z new groovy-macro subproject with code from MacroGroovy (initial contribution) commit 546868aaae30335b9b6fc1a67bb6cf1dc2b84cff Author: Sergey Egorov <bsid...@gmail.com> Date: 2014-07-03T09:45:29Z shared code between MacroGroovy and AstBuilderTransformation commit 205603597f13606c356c18940546f6dc3f87a7e0 Author: Sergey Egorov <bsid...@gmail.com> Date: 2014-07-02T21:46:13Z new groovy-macro subproject with code from MacroGroovy (initial contribution) commit df5fa06ee6ce3212a4c98b6cae13c6c4a6b6dec5 Author: Sergey Egorov <bsid...@gmail.com> Date: 2014-07-03T09:45:29Z shared code between MacroGroovy and AstBuilderTransformation commit ff1d4a0e73fb724816d9b9bf07e585888c42c7ba Author: Sergey Egorov <bsid...@gmail.com> Date: 2014-07-03T19:21:15Z more "macro" usage examples in SimpleMacroTest commit 0efac35d23465158f4450051409063a10320405e Author: Sergey Egorov <bsid...@gmail.com> Date: 2014-07-03T19:21:58Z fix wrong macro test case superclass commit 6d277a078ef32378afb0d9d271b2e4cf4031cf45 Author: Sergey Egorov <bsid...@gmail.com> Date: 2014-07-03T19:57:35Z CompilePhase support in macro commit 01805ce63fdc261489817fd694ec2ad6d806104c Author: Sergey Egorov <bsid...@gmail.com> Date: 2014-07-03T19:21:15Z more "macro" usage examples in SimpleMacroTest commit b28460b00f371082ae132f6f0c3b23589a8dd839 Author: Sergey Egorov <bsid...@gmail.com> Date: 2014-07-03T19:21:58Z fix wrong macro test case superclass commit f0805101fdf844a03ba556281e6ea5bc89a5d637 Author: Sergey Egorov <bsid...@gmail.com> Date: 2014-07-03T19:57:35Z CompilePhase support in macro commit a522e8ff44f1c2e11154376ec600944f9787bd57 Author: Cedric Champeau <cedric.champ...@gmail.com> Date: 2014-10-14T18:29:26Z First bits of work on a contextual class code visitor commit 7704cf90379790d59db8917c4ed38b8052518cb6 Author: Cedric Champeau <cedric.champ...@gmail.com> Date: 2014-10-15T08:08:33Z Add some closure variants for nicer DSL commit 248e0fd9530573d234212d7b3627e3d42168fde4 Author: Cedric Champeau <cedric.champ...@gmail.com> Date: 2014-10-15T16:35:08Z First prototype of an AST pattern matcher. * implemetation is *far from complete* * no unit test * implemented both match/find operations * moved the context aware visitor to the macro project commit 09758c34899f09285c8333e20f4e855ab28de2e6 Author: Cedric Champeau <cedric.champ...@gmail.com> Date: 2014-10-16T10:09:25Z Add support for generating classes through a MacroClass block * instead of using def ast = macro { class A {} }, use def ast=new MacroClass() { class A{} } * substitutions broken due to incorrect scoping of the closure expression representing the substitution commit cae1462040b42431872d8c645e94f890b6863c9c Author: Cedric Champeau <cedric.champ...@gmail.com> Date: 2014-10-16T12:50:38Z Fixed anonymous inner MacroClass being kept in the module as a class to be compiled even though it won't be used. Fixes the problem of the scoping of macro substitutions. commit f736c6ad3beef8051c7c563ca5d9256cb7fbfc6b Author: Cedric Champeau <cedric.champ...@gmail.com> Date: 2014-10-16T15:29:37Z First load of unit tests for ASTMatcher commit 3eba53cc62703929045ee353082f6432a88d061a Author: Cedric Champeau <cedric.champ...@gmail.com> Date: 2014-10-16T15:48:04Z ASTMatcher: Test cases for closure expression and boolean expression commit 02e53fcfe7f9cc625489ace128761eef4e828392 Author: Cedric Champeau <cedric.champ...@gmail.com> Date: 2014-10-17T08:38:16Z ASTMatcher: Test cases for not/list/map expressions commit bac61a14d911484a81b4857109e17871c9af1dbf Author: Cedric Champeau <cedric.champ...@gmail.com> Date: 2014-10-17T09:58:41Z ASTMatcher:First test cases for class types commit 817bbef37672228eefe6c93fd557613b51686f27 Author: Cedric Champeau <cedric.champ...@gmail.com> Date: 2014-10-17T11:10:44Z ASTMatcher: Fix visitListExpression implentation commit 8c1f263477e31f6a5339655b94734c0e5f98dd03 Author: Cedric Champeau <cedric.champ...@gmail.com> Date: 2014-10-17T11:39:20Z ASTMatcher: Add support for if/else commit 199187e1cd539eed62f1a00f70b4f5650c053255 Author: Cedric Champeau <cedric.champ...@gmail.com> Date: 2014-10-17T11:47:25Z ASTMatcher: Add support for for loop commit 5a01b997436e9191b8038a7a7e4e3f428b6da636 Author: Cedric Champeau <cedric.champ...@gmail.com> Date: 2014-10-17T11:51:17Z ASTMatcher: Add support for while loop commit 4b7db4c1ea3f229800c2279b38b19b88db9dabeb Author: Cedric Champeau <cedric.champ...@gmail.com> Date: 2014-10-17T13:27:11Z ASTMatcher: Fix matcher of class nodes not checking superclass commit 1cd27ea261a9eb712234e996115dcc5d3f039f53 Author: Cedric Champeau <cedric.champ...@gmail.com> Date: 2014-10-17T14:05:26Z ASTMatcher: First bits of work for wildcard matching commit cd39e26d6e648417f23beed441fc26c728b1f778 Author: Cedric Champeau <cedric.champ...@gmail.com> Date: 2014-10-17T14:19:21Z ASTMatcher: Rework wildcard so that it only works on the pattern side commit bcd68a75c6909820faf2f7a19b8068613f3e93de Author: Cedric Champeau <cedric.champ...@gmail.com> Date: 2014-10-18T08:40:54Z ASTMatcher: Add constraints to pattern matching * work in progress: add a MatchingConstraints class corresponding to the constraints being applied to the pattern * constraints are defined using a DSL called through the ASTMatcher.withConstraints method * rename some parameters in ASTMatcher to improve readability of algorithms commit 3271e6dcce6a02377848640ace5de048e91c6b21 Author: Cedric Champeau <cedric.champ...@gmail.com> Date: 2014-11-12T07:29:12Z Add ability to relax binary expression matching thanks to constraints on token type commit bea3042479e330ee4e72b5676390d89ff425274d Author: Cedric Champeau <cedric.champ...@gmail.com> Date: 2014-11-12T09:58:06Z ASTMatcher: Fix matcher constraints ordering commit 3d6d571dd3dea0f6d93c8af810f89249ea9ca570 Author: Cedric Champeau <cedric.champ...@gmail.com> Date: 2014-11-12T10:18:08Z ASTMatcher: Add test case for simplified AST matcher with 2 constraints in the same block ---- --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---