Paul King created GROOVY-10378:
----------------------------------

             Summary: Provide a mechanism to prioritise AST transforms running 
at the same stage
                 Key: GROOVY-10378
                 URL: https://issues.apache.org/jira/browse/GROOVY-10378
             Project: Groovy
          Issue Type: Improvement
            Reporter: Paul King


As compilation proceeds, the compiler's data structures typically gain 
additional information as the various parts of the compiler enrich that data. 
Ideally, AST transforms should be introduced once all of the data they need is 
ready. However, the order of processing becomes a secondary factor in 
determining what phase a transform will run.

AST Transforms target a particular phase with transforms in earlier phases 
running first. For transforms in the same phase, the order they appear in the 
source code determines which ones run first. If framework writers rely on 
certain transforms to run first, they might delay some transforms to later 
stages. This places additional constraints on framework writers which are 
further compounded when using annotation collectors (meta-annotations) since 
they list component transforms in a particular order.

This issue is to allow framework developers some ability to order transforms in 
the same phase using a priority. Transforms with a higher priority (determined 
by an integer value) run first.

If no priority is given, a priority of 0 is assumed. Transforms with the same 
priority run in the order in which they appear. To make a transform run before 
others, give it a higher positive value. A negative priority will send the 
transform to the end of the list.

Initially, we don't anticipate changing many of the internal Groovy transforms 
away from a priority of 0. We provide no mechanism for negotiating priority 
between frameworks.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to