Support for restricting commutativity #33
No reviewers
Labels
No labels
Compat/Breaking
Kind
Bad merge
Kind
Bug
Kind
Documentation
Kind
Enhancement
Kind
Feature
Kind
New language
Kind
Security
Kind
Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: mergiraf/mergiraf#33
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "wetneb/mergiraf:5-restrict-commutativity"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This is one attempt to add support for restricting which types of children are able to commute inside a commutative parent (#5).
For each commutative parent, one can define any number of "children groups", which are lists of children types allowed to commute together.
If no children groups are provided, the current behaviour of letting all children commute remains.
I don't know if this is the right way to specify this. As the failing example demonstrates, this also forbids reordering as soon as there is a comment involved (unless comments are explicitly added in the children groups), which is perhaps a good thing given that we're not able to handle them reliably yet (#26).
@zanbaldwin @keirlawson does this go in the right direction?
4c438aae9a
tof7cd837693
@ -213,0 +220,4 @@
ChildrenGroup::new(&["field_declaration"]),
ChildrenGroup::new(&["function_definition"])
],
}
Here is an example of how it can be used in a language profile.
If I'm understanding the examples correctly these groups members have to all be adjacent to each other, this fits the Scala use case well as we might have imports defined lower down in our program that change behavior that we wouldn't want to commute with the traditional imports at the top of the file.
7c7a9536f7
to3b85eac4cb
WIP: Support for restricting commutativityto Support for restricting commutativityLet's merge this already, for the sake of enabling the feature for other languages. I intend to go through existing languages and review if they would benefit from the feature.