Skip to content

Remove DelayedDeclLists from PersistentParserState #29071

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

Merged
merged 4 commits into from
Jan 8, 2020

Conversation

hamishknight
Copy link
Contributor

DelayedDeclLists is currently only used by -verify and -dump-parse to fully parse the bodies of types which we've previously skipped.

For -verify, avoid doing this as ideally we shouldn't emit any additional parsing diagnostics that an equivalent invocation without -verify would. For -dump-parse, tell the parser not to delay any bodies.

In addition, this PR enables the delayed body parsing for -parse of a non-primary main file, which better matches the behavior of parseAndTypeCheckMainFileUpTo.

Given `-verify` is used for testing, ideally it
shouldn't exhibit different behaviour to an
equivalent invocation without it.
Rather than parsing all delayed bodies for
`-dump-parse` once we finish parsing, tell the
parser not to delay any bodies. This then allows
us to remove `DelayedDeclLists` from
PersistentParserState.
This better matches the behavior of
`parseAndTypeCheckMainFileUpTo`.
`performParseOnly` has been able to handle
multiple input files for a while now.
@hamishknight
Copy link
Contributor Author

@swift-ci please test

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

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

Cool!

@hamishknight hamishknight merged commit 1aa9508 into swiftlang:master Jan 8, 2020
@hamishknight hamishknight deleted the prompt-parsing branch January 8, 2020 22:43
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.

3 participants