-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[move-compiler-v2] add parser code for lambda types #14792
Merged
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
⏱️ 2h 37m total CI duration on this PR
|
22 tasks
22 tasks
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 09-27-extend_parser_for_lambda_types #14792 +/- ##
=======================================================================
Coverage ? 59.9%
=======================================================================
Files ? 852
Lines ? 207826
Branches ? 0
=======================================================================
Hits ? 124528
Misses ? 83298
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
brmataptos
force-pushed
the
09-27-extend_parser_for_lambda_types
branch
from
September 30, 2024 17:09
7f59256
to
ae73f37
Compare
brmataptos
force-pushed
the
09-27-add_parser_code_for_lambda_types
branch
from
September 30, 2024 17:09
dbd482d
to
270214e
Compare
brmataptos
force-pushed
the
09-27-extend_parser_for_lambda_types
branch
from
September 30, 2024 18:43
ae73f37
to
243ea0f
Compare
brmataptos
force-pushed
the
09-27-add_parser_code_for_lambda_types
branch
from
September 30, 2024 18:44
270214e
to
afbad9b
Compare
brmataptos
force-pushed
the
09-27-extend_parser_for_lambda_types
branch
from
October 3, 2024 01:42
243ea0f
to
f3d30eb
Compare
brmataptos
force-pushed
the
09-27-add_parser_code_for_lambda_types
branch
from
October 3, 2024 01:43
a40a3c9
to
71ef91f
Compare
brmataptos
force-pushed
the
09-27-extend_parser_for_lambda_types
branch
from
October 3, 2024 01:52
f3d30eb
to
0cc6890
Compare
brmataptos
force-pushed
the
09-27-add_parser_code_for_lambda_types
branch
from
October 3, 2024 01:53
71ef91f
to
3a1d362
Compare
brmataptos
force-pushed
the
09-27-extend_parser_for_lambda_types
branch
from
October 3, 2024 04:42
0cc6890
to
1b54f30
Compare
brmataptos
force-pushed
the
09-27-add_parser_code_for_lambda_types
branch
2 times, most recently
from
October 3, 2024 06:09
c46a244
to
b3c1106
Compare
brmataptos
force-pushed
the
09-27-extend_parser_for_lambda_types
branch
from
October 3, 2024 17:01
ad600f0
to
017f471
Compare
brmataptos
force-pushed
the
09-27-add_parser_code_for_lambda_types
branch
from
October 3, 2024 17:01
b3c1106
to
a65ee0f
Compare
brmataptos
force-pushed
the
09-27-extend_parser_for_lambda_types
branch
from
October 10, 2024 04:18
017f471
to
b7d429a
Compare
brmataptos
force-pushed
the
09-27-add_parser_code_for_lambda_types
branch
from
October 10, 2024 04:18
a65ee0f
to
cbb77b0
Compare
brmataptos
force-pushed
the
09-27-extend_parser_for_lambda_types
branch
from
October 10, 2024 05:25
b7d429a
to
c99de22
Compare
brmataptos
force-pushed
the
09-27-add_parser_code_for_lambda_types
branch
from
October 10, 2024 05:25
cbb77b0
to
b2185c2
Compare
brmataptos
force-pushed
the
09-27-extend_parser_for_lambda_types
branch
from
October 18, 2024 18:03
c99de22
to
d3254ad
Compare
brmataptos
force-pushed
the
09-27-add_parser_code_for_lambda_types
branch
from
October 18, 2024 18:04
b2185c2
to
3f98e56
Compare
brmataptos
force-pushed
the
09-27-extend_parser_for_lambda_types
branch
from
October 18, 2024 18:08
d3254ad
to
7e21319
Compare
brmataptos
force-pushed
the
09-27-add_parser_code_for_lambda_types
branch
from
October 18, 2024 18:08
3f98e56
to
e24bf4e
Compare
brmataptos
force-pushed
the
09-27-extend_parser_for_lambda_types
branch
from
October 21, 2024 07:10
7e21319
to
7cfe2c4
Compare
brmataptos
force-pushed
the
09-27-add_parser_code_for_lambda_types
branch
from
October 21, 2024 07:10
e24bf4e
to
2a740e8
Compare
brmataptos
force-pushed
the
09-27-add_parser_code_for_lambda_types
branch
from
October 26, 2024 00:05
2a740e8
to
dabc427
Compare
rahxephon89
approved these changes
Nov 30, 2024
…le of function type
…unnecessarily; avoid generating errors/warnings about default Loc
…ionExpr to Value::Function, got things mostly back in shape
…for abilities in lambda_lifter.rs
…constraints to avoid reducing set of function type abilities when unifying types
…to bind leading arguments
…ser location on `||`
brmataptos
force-pushed
the
09-27-add_parser_code_for_lambda_types
branch
from
December 1, 2024 05:57
bab1e7d
to
4cf9a1a
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
✅ Forge suite
|
✅ Forge suite
|
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.
Description
Extend syntax
move |args| body with copy+store
. Note that:has copy, store
because commas will confuse parsing in many situationhas copy+store
because that leads to nonuniform syntax withhas
with
, so that's what we're using.|T1, T2| T3 with copy+store
|a, b| f(x, 3, a, b)
EarlyBind
expression now takes a function-valued expression and a set of argument expressions, which correspond to a prefix of the function parameters.(|x, y| x + y)(2, 3)
Modify exp_builder and lambda_lifter to generate function values.
Modify model to track "used" functions in addition to "called" functions to be able to catch all dependencies when function values are created but not called.
Attaches an
AbilitySet
toType::Fun
andExp::Lambda
based on source. Adds a newExpCall
operation in parser/expansion ASTs to be able to carry more generalized function calls through to move-model, which already can support this throughInvoke
, which previously was underutilized. Added basic type checking for function abilities.Current Gaps
I was targeting the test cases
return_func.move
anddoable_func.move
, but this PR is still missingstore
for function values built by curry with only storable parametersI will try to patch those in while this is being reviewed, or add them to a later PR.
How Has This Been Tested?
Added more lambda tests under
move-compiler-v2/tests/lambda/
which are run "with" and "without" lambda features enabled. Currently, many things pass through to hit "not yet implemented" errors in bytecode gen, etc.Ran and carefully checked all tests under third_party and aptos.
Key Areas to Review
Key features are illustrated in test
move-compiler-v2/tests/lambda/storable/doable_func.move
and the two corresponding output files, along with the testreturn_func.move
in the same directory. Most other test outputs should be largely unchanged, although error messages related to lambda use in default configuration have changed.Tricky features are:
ty.rs
: unification checksFun
abilities as well as other things.lambda_lifter.rs
, we (1) reject lambdas withoutmove
free-var handling, (2) try to reduce lambda to curry, by checking for a simple function call with simple args, the last of which are identical to the lambda parameters.Type of Change
Which Components or Systems Does This Change Impact?
Checklist