Repository navigation
feat: control-flow syntax pass - #53
Merged
Merged
Conversation
…globals and chained assignments
…lower lambdas, nested functions, sets and global stores
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.
Summary
Second syntax pass, driven by the twelve repositories under
tests-project/: the constructs that add control flow or a scope inside an expression, plus the last statement forms they used.test: define conditional expressions, comprehensions, lambdas, sets, globals and chained assignments), implementation follows.Conditional,Lambda,Set, dictionary comprehensions (Comprehension.key) and tuple comprehension targets; scopes give lambdas a function scope and comprehensions keep their own, as before. A chained assignment becomes one hidden local assigned once and every target assigned from it.ifs filling a synthetic list, set or dict throughappend,addor an item store, with comprehension variables renamed to synthetic locals so they do not leak into the function. The CFG carriessynthetic_localsand the lowering treats them as locals; everything downstream, SSA, taint, heap, refutation, sees ordinary control flow, so taint through comprehensions comes from the existing container rules. A conditional or comprehension inside awhilecondition is reported as unsupported rather than mislaid.MakeFunctionvalues bound to their name, their bodies not analysed yet, and calls to them stay conservative; assignments toglobalnames becomeSetGlobal; set literals buildBuildSet.Measured on the twelve repositories: ten analyse with no syntax note at all; the last two use a
matchstatement and adelstatement.