Skip to content

Conversation

@auduchinok
Copy link
Member

@auduchinok auduchinok commented Apr 6, 2023

Adds recovery for missing types in declarations:

type R =
    { F: }
type R =
    { F }
type U =
    | A of i:
type T =
    val x:
type T() =
    inherit
type T() =
    interface
type T() =
    member val P: = 1

It also disallows interface declaration members to be at the same indentation when the new indentation rules are enabled:

type I =
    interface
    abstract P: int
    end

and requires at least one additional space:

type I =
    interface
        abstract P: int
    end

It's needed for recovery of unfinished interface members:

type T() =
    interface // unfinished
    member this.P = 1 // was incorrectly parsed as an interface member

@auduchinok auduchinok requested a review from a team as a code owner April 6, 2023 14:57
@auduchinok auduchinok force-pushed the parser-synType-fromParseError branch 2 times, most recently from 6648b13 to bea5fb2 Compare April 11, 2023 12:10
@auduchinok auduchinok changed the title Parser: add SynType.FromParseError, recover missing types in decls Parser: recover on missing types in decls Apr 11, 2023
@auduchinok auduchinok force-pushed the parser-synType-fromParseError branch from 0c8e00f to a03f482 Compare June 20, 2023 11:56
@edgarfgp
Copy link
Contributor

edgarfgp commented Sep 7, 2023

Screenshot 2023-09-07 140044

Would it make sense to include the following scenario here too?

@auduchinok
Copy link
Member Author

Would it make sense to include the following scenario here too?

Yes, but it's unrelated to this PR. 🙂

@auduchinok
Copy link
Member Author

The most of the changes have been proposed via separate PRs. We can close this one now 🎉

@auduchinok auduchinok closed this Sep 7, 2023
@auduchinok auduchinok deleted the parser-synType-fromParseError branch September 7, 2023 14:58
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.

3 participants