-
Notifications
You must be signed in to change notification settings - Fork 64
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
Add Comprehensions of Lists, Sets and Maps and generator expressions #1786
Merged
Conversation
This file contains 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
KuechA
commented
Oct 17, 2024
...anguage-python/src/main/kotlin/de/fraunhofer/aisec/cpg/frontends/python/ExpressionHandler.kt
Outdated
Show resolved
Hide resolved
.../main/kotlin/de/fraunhofer/aisec/cpg/graph/statements/expressions/CollectionComprehension.kt
Outdated
Show resolved
Hide resolved
@konradweiss please check and update the EOG implementation and specs |
KuechA
changed the title
Add Comprehensions of Lists, Sets and Maps
Add Comprehensions of Lists, Sets and Maps and generator expressions
Oct 18, 2024
…ntax error in comprehension expression
…C/cpg into ak/slice-all-collections
…t holds statements
KuechA
requested review from
maximiliankaul,
lshala,
konradweiss and
oxisto
as code owners
October 24, 2024 12:46
konradweiss
approved these changes
Oct 24, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
maximiliankaul
approved these changes
Oct 29, 2024
cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/builder/Fluent.kt
Show resolved
Hide resolved
cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/builder/Fluent.kt
Show resolved
Hide resolved
cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/edges/collections/UnwrappedEdgeList.kt
Show resolved
Hide resolved
cpg-core/src/test/kotlin/de/fraunhofer/aisec/cpg/graph/FluentTest.kt
Outdated
Show resolved
Hide resolved
cpg-core/src/test/kotlin/de/fraunhofer/aisec/cpg/graph/FluentTest.kt
Outdated
Show resolved
Hide resolved
...age-python/src/test/kotlin/de/fraunhofer/aisec/cpg/frontends/python/ExpressionHandlerTest.kt
Outdated
Show resolved
Hide resolved
.../main/kotlin/de/fraunhofer/aisec/cpg/graph/statements/expressions/ComprehensionExpression.kt
Outdated
Show resolved
Hide resolved
.../main/kotlin/de/fraunhofer/aisec/cpg/graph/statements/expressions/ComprehensionExpression.kt
Show resolved
Hide resolved
.../main/kotlin/de/fraunhofer/aisec/cpg/graph/statements/expressions/ComprehensionExpression.kt
Show resolved
Hide resolved
.../main/kotlin/de/fraunhofer/aisec/cpg/graph/statements/expressions/ComprehensionExpression.kt
Show resolved
Hide resolved
lshala
pushed a commit
that referenced
this pull request
Nov 8, 2024
…1786) * Add comprehension expression * Initial python translation for listcomp * SetComp and DictComp in python frontend * First simple tests * test in main * Try to add DFG edges * Fix not implemented error * Fix more bugs * Also handle GeneratorExp, add some documentation. * Extract nested class to own file * Fix bug, aggregate predicates * Remove unnecessary changes * Specify idea for EOG * Fake higher test coverage * More testing * More tests * Fix error from renaming * Handle the comprehension expression in the control flow sensitive DFG * Adding alternatives to EOG for collection comprehension and fixing syntax error in comprehension expression * Adding alternative that properly depicts generator behavior * Small fix * Alternative for ComprehensionExpression * Fix * Adding EOG handling for ComprehensionExpression and CollectionComprehension * Add test and fix EOG pass implementation * Allow th addition to something that holds arguments and something that holds statements * Remove useless stuff from ControlflowSensitiveDFGPass * Make non-optional things non-optional * Fix test * Remove condition to reduce code which needs coverage * More tests * Update stuff * review * review * generator type --------- Co-authored-by: Konrad Weiss <[email protected]>
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.
This PR aims to enable list comprehensions and similar constructs.
Tasks:
Python.AST.ListComp
Python.AST.SetComp
Python.AST.DictComp
Python.AST.GeneratorExp
DFGPass
ControlFlowSensitiveDFGPass
Fixes #1714
Fixes #1715
Fixes #1716
Fixes #1717