Formalize some SourceFile parsing outputs

Currently when parsing a SourceFile, the parser
gets handed pointers so that it can write the
interface hash and collected tokens directly into
the file. It can also call `setSyntaxRoot` at
the end of parsing to set the syntax tree.

In preparation for the removal of
`performParseOnly`, this commit formalizes these
values as outputs of `ParseSourceFileRequest`,
ensuring that the file gets parsed when the
interface hash, collected tokens, or syntax tree
is queried.
This commit is contained in:
Hamish Knight
2020-06-03 11:03:56 -07:00
parent 5fdc5f3098
commit f57299a587
17 changed files with 166 additions and 90 deletions

View File

@@ -719,9 +719,7 @@ public:
}
void parse() {
auto root = Parser->parse();
if (SynTreeCreator)
SynTreeCreator->acceptSyntaxRoot(root, Parser->getSourceFile());
Parser->parse();
}
SourceFile &getSourceFile() {