Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork669
break: Add support for labeled statements, breaks, and continues#2891
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
60e57da
to3a29149
CompareI just need to add some tests; then, this will be ready to merge. @JairusSW Heads up: this change definitely breaks transforms. Do you have anything to comment on this PR? |
It looks like I forgot about |
CountBleck commentedDec 17, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Okay, it appears that my code breaks something related to Flow flags, so more work on this PR is needed. One issue is that Another issue is that a |
This is a prerequisite for supporting labeled breaks/continues. Clearlyunusable labels, such as `x: let foo = 1;` report an error by default,similar to TS's behavior.
This requires an additional field to Flow that maps user-definedstatement labels to the internal Binaryen labels passed to module.br().Thanks to the existing logic to handle unlabeled break/continue, addingsupport for labeled break/continue is a breeze.FixesAssemblyScript#2889.
3a29149
to692b388
CompareIn TS, there are new ASTNode |
@HerrCai0907 I considered that before, and it might be a pretty good idea. It would be better for transform users for sure. Still, there's the issue of setting the proper |
Uh oh!
There was an error while loading.Please reload this page.
Fixes#2889.
Changes proposed in this pull request:
⯈ Support labeled statements in the parser/AST
⯈ Support labeled
break
/continue
.This change is breaking solely because it modifies the
Node.createXXX
APIs, which are used by transforms.