Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Linearity check array comprehensions #615

Merged
merged 3 commits into from
Nov 11, 2024

Conversation

mark-koch
Copy link
Collaborator

Refactor the list comprehension logic so we can also use it for array comprehensions

@mark-koch mark-koch requested a review from a team as a code owner November 4, 2024 13:19
@mark-koch mark-koch requested review from doug-q and removed request for a team November 4, 2024 13:19
@codecov-commenter
Copy link

codecov-commenter commented Nov 4, 2024

Codecov Report

Attention: Patch coverage is 90.76923% with 6 lines in your changes missing coverage. Please review.

Project coverage is 91.70%. Comparing base (37a7118) to head (e25c3e2).
Report is 4 commits behind head on feat/array-compr.

Files with missing lines Patch % Lines
guppylang/prelude/_internal/checker.py 91.83% 4 Missing ⚠️
guppylang/checker/expr_checker.py 87.50% 1 Missing ⚠️
guppylang/checker/linearity_checker.py 80.00% 1 Missing ⚠️
Additional details and impacted files
@@                 Coverage Diff                  @@
##           feat/array-compr     #615      +/-   ##
====================================================
+ Coverage             91.55%   91.70%   +0.15%     
====================================================
  Files                    60       60              
  Lines                  6463     6497      +34     
====================================================
+ Hits                   5917     5958      +41     
+ Misses                  546      539       -7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -356,11 +360,11 @@ def _check_assign_targets(self, targets: list[ast.expr]) -> None:
self.scope.assign(tgt_place)

def _check_comprehension(
self, node: DesugaredListComp, gens: list[DesugaredGenerator]
self, node: ast.expr, gens: list[DesugaredGenerator], elt: ast.expr
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like node is unused?

Base automatically changed from array-compr/check to feat/array-compr November 11, 2024 15:23
@mark-koch mark-koch merged commit ecc7c8d into feat/array-compr Nov 11, 2024
2 checks passed
@mark-koch mark-koch deleted the array-compr/linearity branch November 11, 2024 15:31
github-merge-queue bot pushed a commit that referenced this pull request Dec 2, 2024
Adds array comprehensions of the form `array(i for i in range(10))`.

This is the base PR that adds new AST nodes for array comprehensions and
general generator expressions. Checking and lowering logic follows in
subsequent PRs targetting this branch:
* #614
* #615 
* #616

Closes #612
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants