Skip to content

Conversation

@auduchinok
Copy link
Member

Adds parser recovery for unfinished binary app expressions that have their right operand missing and that are placed before other declarations or before the end of file.

End of file:

1 +

Before type decl:

1 + 

type T = int

Before attributes in a decl:

1 +

[<Attr>]
let x = 1

Thanks to @dsyme for guiding me on where to look at.

I'll start adding new tests when the existing ones are green.

@auduchinok
Copy link
Member Author

The following case got broken:

let f
    (
        a,
        [<A>] b
    ) = ()

I'm (hopefully, temporarily) undoing the before-[< recovery to see if anything else gets broken.

@psfinaki
Copy link
Contributor

@auduchinok hey there, would you like to continue on that? I can help with resolving conflicts if needed. Also, probably some testing would be useful here.

@auduchinok
Copy link
Member Author

@psfinaki Yes, I'm going to get back to it. Perhaps I'll need to rethink the approach here... I'll resolve the conflicts myself, thanks!

@psfinaki
Copy link
Contributor

@auduchinok, thanks, reach out if you need any help!

@auduchinok
Copy link
Member Author

This has been superseded by #15255 and #15334.

The situation with top-level expressions (i.e. at the module scope) is not as good as I'd want it to be, but it'd be really difficult to change it. The good news are local binary expressions seem to be much more common and PRs above improve the recovery very noticeably for them.

@auduchinok auduchinok closed this Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants