Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signature tweak to the grammar. #527

Merged
merged 3 commits into from
May 8, 2023

Conversation

nojaf
Copy link
Contributor

@nojaf nojaf commented May 8, 2023

Extracted the grammar and parser changes from #481

@nojaf nojaf force-pushed the signature-parser-grammar branch from a7883b5 to 05c0e5b Compare May 8, 2023 11:53
INestedModuleDeclaration CreateNestedModule(string name);

IModuleMember CreateModuleMember(string source);
IFSharpTypeMemberDeclaration CreateTypeMemberSignature(string source);
Copy link
Collaborator

Choose a reason for hiding this comment

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

It seems it can also be used to create non-signature type members? If true, then maybe something like CreateTypeMember would be a better name.

Comment on lines +31 to +33
if memberSigs.IsEmpty then
x.AdvanceToTokenOrRangeEnd(FSharpTokenType.END, parentRange)
x.Advance()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you add a parser test and/or a comment about the pending FCS fix for this, please?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, I added a test but the problem is still there.
If there is nothing besides an empty nested module the parentRange will end right before the = token.

@auduchinok
Copy link
Collaborator

@nojaf Thanks a lot!

@auduchinok auduchinok merged commit 3d6b820 into JetBrains:net232 May 8, 2023
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