GROOVY-11878: Invariant loops spike#2400
Open
paulk-asert wants to merge 2 commits intoapache:masterfrom
Open
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #2400 +/- ##
==================================================
- Coverage 66.6744% 66.6566% -0.0178%
- Complexity 29856 29887 +31
==================================================
Files 1382 1386 +4
Lines 116145 116278 +133
Branches 20481 20504 +23
==================================================
+ Hits 77439 77507 +68
- Misses 32361 32421 +60
- Partials 6345 6350 +5
🚀 New features to boost your workflow:
|
ab272e7 to
0428d2d
Compare
…nitially loop statements
…nitially loop statements (demo usage not in final form)
0428d2d to
cdf0c51
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There are two commits:
The first commit contains the proposed grammar and AST plumbing changes. It includes changes to plumb the existing
@Invariantannotation into loops within thegroovy-contractssubproject. There isn't support for other annotations like@Ensures(see example GROOVY-11878) yet which languages like Dafny support. This could be considered for a subsequent PR.The second commit contains a second
@Parallelexample AST transform (see example in GROOVY-11878). It isn't meant to be production quality or included in the merge of this PR, but is another useful check that the AST plumbing changes are working. In particular, the@Paralleltransform doesn't attempt to do any state sharing (bar the loop variable) or protection, it's just a demo.Future work:
@ExtendedTarget(ExtendedTargetType.LOOP)to an@interfacedefinition. Then we could give appropriate error messages when the annotations were used incorrectly.