Skip to content

Fix detection of Let vs LetIn after a 'struct'#324

Merged
NathanReb merged 2 commits intoOCamlPro:masterfrom
Julow:struct-let
Sep 22, 2025
Merged

Fix detection of Let vs LetIn after a 'struct'#324
NathanReb merged 2 commits intoOCamlPro:masterfrom
Julow:struct-let

Conversation

@Julow
Copy link
Contributor

@Julow Julow commented Apr 3, 2023

An indented let inside a struct ... end was incorrectly interpreted as a LetIn.

Same motivation as in #323. The indentation of fun is different inside a Let and a LetIn.

An indented `let` inside a `struct ... end` was incorrectly interpreted
as a `LetIn`.
Copy link
Contributor

@NathanReb NathanReb left a comment

Choose a reason for hiding this comment

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

Sorry for the 2.5 years delay and thanks for the fix!

I took the liberty to rebase your branch. I'm just waiting for the CI to go green and I'll merge!

@NathanReb NathanReb merged commit 05bf65d into OCamlPro:master Sep 22, 2025
7 checks passed
NathanReb pushed a commit to Julow/ocp-indent that referenced this pull request Sep 22, 2025
Signed-off-by: Nathan Rebours <[email protected]>
@Julow
Copy link
Contributor Author

Julow commented Sep 23, 2025

Thanks!

NathanReb pushed a commit to NathanReb/opam-repository that referenced this pull request Oct 1, 2025
CHANGES:

+ Fix detection of let vs letin after a struct (OCamlPro/ocp-indent#324, @Julow)
+ Treat `|>` as a monadic operator (OCamlPro/ocp-indent#322, @nberth)
+ Prevent Args out of range error in ocp-indent-buffer (OCamlPro/ocp-indent#327, @bcc32)
+ Fix "Missing ‘lexical-binding’ cookie" warning in Emacs (OCamlPro/ocp-indent#329, @nojb)
+ Fix a bug where ocp-indent translate LF to CRLF when run on Windows instead
  of preserving the input's newlines. (OCamlPro/ocp-indent#334, @nojb)
+ Add `ocp-indent-gen-rules` to support `dune fmt` like workflow with ocp-indent
  (OCamlPro/ocp-indent#333, @NathanReb)
nojb added a commit to LexiFi/ocp-indent that referenced this pull request Feb 9, 2026
Release 1.9.0

CHANGES:

+ Fix detection of let vs letin after a struct (OCamlPro#324, @Julow)
+ Treat `|>` as a monadic operator (OCamlPro#322, @nberth)
+ Prevent Args out of range error in ocp-indent-buffer (OCamlPro#327, @bcc32)
+ Fix "Missing ‘lexical-binding’ cookie" warning in Emacs (OCamlPro#329, @nojb)
+ Fix a bug where ocp-indent translate LF to CRLF when run on Windows instead
  of preserving the input's newlines. (OCamlPro#334, @nojb)
+ Add `ocp-indent-gen-rules` to support `dune fmt` like workflow with ocp-indent
  (OCamlPro#333, @NathanReb)
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