Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b63aebad8f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
rescript
@rescript/darwin-arm64
@rescript/darwin-x64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/runtime
@rescript/win32-x64
commit: |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 58f81dc3c7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Add support for
breakandcontinuein ReScriptwhileandforloops.This change makes
breakandcontinuereal keywords, supports using them from within aswitchnested inside a loop, and emits native JSbreak/continuein the generated output.Implementation
break/continueas reserved syntax tokens in the ReScript parser.parsetree0frozen and bridge the new nodes through reserved internal extensions in the v0 mappers.break/continueas loop-only control flow and reject them in nested function bodies.break/continuein statement position, matching existingthrow(...)behavior, with clearer wording for non-continuing control flow.break/continue.switchby generating loop labels when needed.loop_<n>ids.Notes
breakandcontinueare now reserved keywords, so existing identifier uses must be escaped or renamed.switchin the output and therefore exercise the labeled codegen path directly.Tests
break/continue.break/continueoutside loopsbreak/continuestatements with following dead codetests/testsfor:while+break/continuefor+break/continueswitchtargeting the enclosing loopVerification
makemake libnode tests/build_tests/super_errors/input.jsnode tests/build_tests/loop_control/input.jsnode cli/rescript.js buildintests/testsnpx mocha -t 10000 tests/tests/src/loop_control_test.mjs