-
Notifications
You must be signed in to change notification settings - Fork 197
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 support for list expressions #372
Comments
I think we should handle them in lowering pass, but there is a bit more to it. @satyamakgec and I discussed this here before the lowering pass existed. The same fundamental issues exist. We could map
to
but that would only work for assignment statements. We want this to work on the expression level, so we need to map i.e.
My concern with this approach in the linked thread was that we would run into This approach isn't too far off from what Rust does with |
If I am not mistaken, We don't need to do anything much on the compiler side as we are already supporting the lowering pass then parser can generate the AST not as the list but as the assignment and rest will be handle automatically with the existing code. Although I am not sure how does the python type list is gonna work (1 .. 100) or using |
That sounds reasonable. We could always tweak it in the future. 👍 |
Closed by #388 |
What is wrong?
We do currently not support list expressions such as
[1, 2, 3]
. While we do have support for it in the parser and partly in the analyzer this comes up repeatedly in crashes found by the fuzzer.See related issues:
How can it be fixed
I'm wondering if we should handle this in the lowering pass. Let's assume we have the following code:
The lowering pass could rewrite that to:
@g-r-a-n-t Do you think it would be reasonable to handle list expressions in the lowering pass so that we could eliminate them completely from the mapping?
The text was updated successfully, but these errors were encountered: