Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Mark return expressions in parsed and typed ASTs#7898

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

Open
cristianoc wants to merge1 commit intomaster
base:master
Choose a base branch
Loading
fromreturn-marker-flags

Conversation

@cristianoc
Copy link
Collaborator

Summary\n- annotate parsed expressions with mutable return flags and propagate into the typed tree\n- add a parser-time pass that marks tail positions and expose an accessor for tooling\n- update helpers and add OUnit coverage for return semantics\n\n## Testing\n- dune build\n- dune runtest tests/ounit_tests\n- make

Signed-off-by: Cristiano Calcagno <cristianoc@users.noreply.github.com>
@cristianoc
Copy link
CollaboratorAuthor

@zth I had to write the prompt AND the patch—next time try not to outsource the entire job to your toaster.

zth reacted with laugh emoji

@cristianoc
Copy link
CollaboratorAuthor

The magic prompt:

Screenshot 2025-09-18 at 05 00 29

Copy link

@chatgpt-codex-connectorchatgpt-codex-connectorbot left a comment

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 suggestions.

Reply with@codex fix comments to fix any unresolved comments.

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, or 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 fix this CI failure" or "@codex address that feedback".

Comment on lines 96 to 100
{funct= fn1; args= (Nolabel, a) :: args; partial; transformed_jsx};
pexp_loc= e.pexp_loc;
pexp_attributes= e.pexp_attributes@ f.pexp_attributes;
pexp_is_return=false;
}

Choose a reason for hiding this comment

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

[P1] Preserve return markers when rewriting application expressions

The newpexp_is_return flag is set byRes_return_marker before the built‑in PPX rewrites applications, butAst_exp_apply.app_exp_mapper now recreates the expression withpexp_is_return = false unconditionally. Any call expression that passes through this mapper (which is invoked for everyPexp_apply inbs_builtin_ppx) will therefore lose its return annotation even when it was in tail position, so the typed AST never exposesexp_is_return for the common case oflet f x = g x. The mapper should carry over the original expression’s flag (and similar for nested cases) rather than resetting it.

Useful? React with 👍 / 👎.

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

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

@codex see if you can repro the issue in a test

chatgpt-codex-connector[bot] reacted with eyes emoji

Choose a reason for hiding this comment

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

Summary

Testing

  • ⚠️dune runtest tests/ounit_tests (fails becausedune is not available in the container)

View task →

@pkg-pr-new
Copy link

Open in StackBlitz

rescript

npm i https://pkg.pr.new/rescript-lang/rescript@7898

@rescript/darwin-arm64

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

@rescript/darwin-x64

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

@rescript/linux-arm64

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

@rescript/linux-x64

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

@rescript/runtime

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/runtime@7898

@rescript/win32-x64

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

commit:a39fb92

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@chatgpt-codex-connectorchatgpt-codex-connector[bot]chatgpt-codex-connector[bot] left review comments

@zthzthAwaiting requested review from zth

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@cristianoc

[8]ページ先頭

©2009-2025 Movatter.jp