这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@ccasin
Copy link

@ccasin ccasin commented Jan 9, 2024

The previous version would attempt to format:

let foo x =
  match x with
  | ~a:(Some _), ~b -> false
  | _ -> true

as

let foo x =
  match x with
  | ~a:Some _, ~b -> false
  | _ -> true

The parens are required by the parser, so the updated version doesn't parse, causing ocamlformat to blow up.

Copy link

@ncik-roberts ncik-roberts left a comment

Choose a reason for hiding this comment

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

  • The logic makes sense.
  • The test case looks good.

I don't know ocamlformat's codebase very well at all, but I think this change looks good.

@ccasin ccasin merged commit b978f42 into oxcaml:jane Jan 9, 2024
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