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

@@ -189,6 +189,12 @@ private:
return getNodeHandler()(&node);
}
Optional<SourceFileSyntax> realizeSyntaxRoot(OpaqueSyntaxNode root,
const SourceFile &SF) override {
// We don't support realizing syntax nodes from the C layout.
return None;
}
void discardRecordedNode(OpaqueSyntaxNode node) override {
// FIXME: This method should not be called at all.
}