Skip to content

Conversation

@aryairani
Copy link
Contributor

@aryairani aryairani commented Dec 23, 2025

Overview

There is a weird situation currently in a match / with where if a function argument starts in the same column as the start of the scrutinee, there's a parse failure. e.g.,

-- ok
match a 
       b c with _ -> ()
-- bad
match a 
      b c with _ -> ()
-- ok
match a 
     b c with _ -> ()
-- bad
match a 
    b c with _ -> ()
-- ok
match a 
   b c with _ -> ()

So that's weird.

How do we want this to work?

If we want all of the above to work, then merging this PR will do that and fix #6048.

  • What does this change accomplish and why?

    • i.e. How does it change the user experience?
    • i.e. What was the old behavior/API and what is the new behavior/API?
  • Include "before and after" examples if appropriate. (You can copy/paste screenshots directly into this editor.)

  • List any Github issues that this PR closes, in closing-issues-using-keywords format.

Implementation approach and notes

The PR just adds match to the set of syntax constructions in which to not emit virtual semis; equivalent to surrounding the contents in parens.

I wonder whether handle/with needs the same treatment? But it didn't exhibit exactly the same bug so idk.

Interesting/controversial decisions

Test coverage

  • Have you included tests (which could be a transcript) for this change, or is it somehow covered by existing tests?

New before-and-after transcript in the two commits.

  • Would you recommend improving the test coverage (either as part of this PR or as a separate issue) or do you think it’s adequate?

Seems good.

  • If you only tested by hand, because that's all that's practical to do for this change, mention that. Include screenshots.

Loose ends

n/a

Final checklist

  • Choose your PR title well: Your pull request title is what's used to create release notes, so please make it descriptive of the change itself, which may be different from the initial motivation to make the change.
  • Update your PR description if the specifics of the PR have changed over time.
  • Include transcripts or screenshots that demonstrate the changed behavior.
  • If you changed .cabal files, make sure the package.yaml files are up-to-date instead.

@aryairani aryairani changed the title Arya/cody6048.claude fix #6048 Dec 23, 2025
@aryairani aryairani force-pushed the arya/cody6048.claude branch 5 times, most recently from 96dfe26 to 33111dc Compare December 23, 2025 06:04
@aryairani aryairani changed the title fix #6048 fix parsing certain multiline match / indentation cases Dec 24, 2025
@aryairani aryairani marked this pull request as ready for review December 24, 2025 15:02
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.

cody roundtrip error

2 participants