Skip to content

Represent explicit expression braces in parsetree v1 - #8678

Merged
cknitt merged 12 commits into
codex/remove-unused-pat-record-labelfrom
codex/pexp-braces
Sep 28, 2026
Merged

cknitt merged 12 commits into
codex/remove-unused-pat-record-labelfrom
codex/pexp-braces

Conversation

@cknitt

@cknitt cknitt commented Sep 26, 2026 •

Copy link
Copy Markdown
Member

Refs #8624

Summary

  • Add Pexp_braces with a separate delimiter location and use it throughout the parser, printer, type checker, editor analysis, and AST visitors.
  • Keep res.braces/ns.braces compatibility decoding and encoding in the frozen v0 AST bridge.
  • Make else formatting follow the same brace handling as if, and preserve multiline pipe formatting when comments precede a braced JSX value.
  • Add AST bridge tests and refresh syntax snapshots, including explicit braces in the diagnostic ML printer.

Tests

  • make test
  • make test-syntax
  • make test-syntax-roundtrip
  • make test-analysis

Stacked on #8684.

@cknitt
cknitt added this pull request to stack #8679 September 26, 2026 06:13
@cknitt
cknitt marked this pull request as ready for review September 26, 2026 06:37

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6710020aa7

ℹ️ 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".

Comment thread compiler/syntax/src/res_printer.ml Outdated
Comment thread compiler/ml/typecore.ml Outdated
@pkg-pr-new

pkg-pr-new Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

rescript

npm i https://pkg.pr.new/rescript@8678

@rescript/belt

npm i https://pkg.pr.new/@rescript/belt@8678

@rescript/darwin-arm64

npm i https://pkg.pr.new/@rescript/darwin-arm64@8678

@rescript/darwin-x64

npm i https://pkg.pr.new/@rescript/darwin-x64@8678

@rescript/linux-arm64

npm i https://pkg.pr.new/@rescript/linux-arm64@8678

@rescript/linux-x64

npm i https://pkg.pr.new/@rescript/linux-x64@8678

@rescript/runtime

npm i https://pkg.pr.new/@rescript/runtime@8678

@rescript/win32-x64

npm i https://pkg.pr.new/@rescript/win32-x64@8678

commit: 3b5ec4c

@codecov

codecov Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.06199% with 48 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.66%. Comparing base (9021982) to head (3b5ec4c).

Files with missing lines Patch % Lines
analysis/src/hint.ml 61.53% 5 Missing ⚠️
compiler/frontend/ast_derive_js_mapper.ml 16.66% 5 Missing ⚠️
compiler/frontend/ast_exp_apply.ml 87.50% 5 Missing ⚠️
compiler/frontend/bs_builtin_ppx.ml 73.68% 5 Missing ⚠️
compiler/syntax/src/res_core.ml 78.94% 4 Missing ⚠️
compiler/ml/builtin_attributes.ml 83.33% 3 Missing ⚠️
compiler/ml/printast.ml 0.00% 3 Missing ⚠️
compiler/syntax/src/res_parsetree_viewer.ml 81.25% 3 Missing ⚠️
analysis/src/completion_front_end.ml 88.88% 2 Missing ⚠️
compiler/ml/ast_mapper_from0.ml 88.23% 2 Missing ⚠️
... and 7 more
Additional details and impacted files
@@                           Coverage Diff                            @@
##           codex/remove-unused-pat-record-label    #8678      +/-   ##
========================================================================
+ Coverage                                 78.62%   78.66%   +0.03%     
========================================================================
  Files                                       476      476              
  Lines                                     64198    64380     +182     
========================================================================
+ Hits                                      50477    50645     +168     
- Misses                                    13721    13735      +14     
Files with missing lines Coverage Δ
analysis/reanalyze/src/annotation.ml 52.63% <ø> (ø)
analysis/src/completion_expressions.ml 85.32% <100.00%> (ø)
analysis/src/completion_jsx.ml 73.26% <100.00%> (+0.26%) ⬆️
analysis/src/document_symbol.ml 56.09% <100.00%> (+0.54%) ⬆️
analysis/src/dump_ast.ml 42.53% <100.00%> (+9.66%) ⬆️
analysis/src/process_attributes.ml 84.21% <100.00%> (+0.42%) ⬆️
analysis/src/xform.ml 88.44% <100.00%> (+0.08%) ⬆️
compiler/frontend/ast_attributes.ml 91.13% <ø> (ø)
compiler/frontend/ast_external_process.ml 78.47% <100.00%> (+0.07%) ⬆️
compiler/frontend/ast_open_cxt.ml 100.00% <100.00%> (ø)
... and 31 more

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cknitt

cknitt commented Sep 26, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eaa2818c1e

ℹ️ 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".

Comment thread compiler/ml/parsetree.ml
Comment thread analysis/src/completion_front_end.ml
@cknitt

cknitt commented Sep 26, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 792a5491dc

ℹ️ 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".

Comment thread compiler/syntax/src/jsx_v4.ml
Comment thread compiler/ml/typecore.ml
Comment thread compiler/ml/parsetree.ml
Base automatically changed from codex/switch-case-braces to master September 27, 2026 12:24
@cknitt
cknitt removed this pull request from stack #8679 September 27, 2026 12:30
@cknitt
cknitt changed the base branch from master to codex/remove-unused-pat-record-label September 27, 2026 12:31
@cknitt
cknitt added this pull request to stack #8683 September 27, 2026 12:31
Signed-off-by: Christoph Knittel <ck@cca.io>
Signed-off-by: Christoph Knittel <ck@cca.io>
Signed-off-by: Christoph Knittel <ck@cca.io>
Signed-off-by: Christoph Knittel <ck@cca.io>
Signed-off-by: Christoph Knittel <ck@cca.io>
Signed-off-by: Christoph Knittel <ck@cca.io>
@cknitt

cknitt commented Sep 27, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 70a3ebc488

ℹ️ 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".

Comment thread compiler/ml/parsetree.ml
Signed-off-by: Christoph Knittel <ck@cca.io>
@cknitt

cknitt commented Sep 27, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5f83b6354e

ℹ️ 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".

Comment thread compiler/ml/parsetree.ml
Comment thread compiler/syntax/src/res_core.ml
Signed-off-by: Christoph Knittel <ck@cca.io>
@cknitt

cknitt commented Sep 27, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4308fc7387

ℹ️ 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".

Comment thread compiler/syntax/src/jsx_v4.ml
Comment thread compiler/syntax/src/res_core.ml
Comment thread compiler/syntax/src/res_core.ml
Signed-off-by: Christoph Knittel <ck@cca.io>
Signed-off-by: Christoph Knittel <ck@cca.io>
@cknitt

cknitt commented Sep 27, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 15db2d387e

ℹ️ 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".

Comment thread compiler/frontend/ast_exp_apply.ml Outdated
Comment thread compiler/frontend/ast_open_cxt.ml
Comment thread analysis/src/utils.ml
Signed-off-by: Christoph Knittel <ck@cca.io>
@cknitt

cknitt commented Sep 27, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bc98bf5ff0

ℹ️ 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".

Comment thread analysis/src/completion_expressions.ml
Comment thread compiler/ml/parsetree.ml
Signed-off-by: Christoph Knittel <ck@cca.io>
@cknitt

cknitt commented Sep 28, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 3b5ec4cc8d

ℹ️ 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".

@cknitt
cknitt merged commit 710b5a7 into master Sep 28, 2026
24 checks passed
@cknitt
cknitt deleted the codex/pexp-braces branch September 28, 2026 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants