Skip to content

Parser: recover on missing types in decls - #15042

Closed
auduchinok wants to merge 1 commit into
dotnet:mainfrom
auduchinok:parser-synType-fromParseError
Closed

Parser: recover on missing types in decls#15042
auduchinok wants to merge 1 commit into
dotnet:mainfrom
auduchinok:parser-synType-fromParseError

Conversation

@auduchinok

@auduchinokauduchinok commented Apr 6, 2023

Copy link
Copy Markdown
Member

Adds recovery for missing types in declarations:

typeR={ F:}
typeR={ F }
typeU=| A ofi:
typeT=valx:
typeT()=inherit
typeT()=interface
typeT()=member valP:=1

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

typeI=interfaceabstractP:intend

and requires at least one additional space:

typeI=interfaceabstractP:intend

It's needed for recovery of unfinished interface members:

typeT()=interface// unfinishedmemberthis.P=1// was incorrectly parsed as an interface member

@auduchinok
auduchinok requested a review from a team as a code ownerApril 6, 2023 14:57
@auduchinok
auduchinokforce-pushed the parser-synType-fromParseError branch 2 times, most recently from 6648b13 to bea5fb2CompareApril 11, 2023 12:10
@auduchinokauduchinok changed the title Parser: add SynType.FromParseError, recover missing types in declsParser: recover on missing types in declsApr 11, 2023
@auduchinok
auduchinokforce-pushed the parser-synType-fromParseError branch from 0c8e00f to a03f482CompareJune 20, 2023 11:56
@edgarfgp

Copy link
Copy Markdown
Contributor
Screenshot 2023-09-07 140044

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

@auduchinok

Copy link
Copy Markdown
MemberAuthor

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

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

@auduchinok

Copy link
Copy Markdown
MemberAuthor

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

@auduchinok
auduchinok deleted the parser-synType-fromParseError branch September 7, 2023 14:58
Sign up for freeto 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

@auduchinok@edgarfgp@T-Gro