[libSyntax] Re-enable dumping of ParsedRawSyntaxNode children

This requires a SyntaxParsingContext to be passed to the dump function
and was thus disabled in an earlier commit
This commit is contained in:
Alex Hoppen
2021-03-04 10:32:02 +01:00
parent c8acecd15d
commit 439b44b365
6 changed files with 45 additions and 4 deletions

View File

@@ -187,6 +187,9 @@ public:
getDeferredChild(size_t ChildIndex,
const SyntaxParsingContext *SyntaxContext) const;
size_t
getDeferredNumChildren(const SyntaxParsingContext *SyntaxContext) const;
ParsedRawSyntaxNode copyDeferred() const {
assert(isDeferredLayout() || isDeferredToken() && "node not deferred");
ParsedRawSyntaxNode copy;
@@ -203,8 +206,10 @@ public:
/// Dump this piece of syntax recursively for debugging or testing.
SWIFT_DEBUG_DUMP;
/// Dump this piece of syntax recursively.
void dump(raw_ostream &OS, unsigned Indent = 0) const;
/// Dump this piece of syntax recursively. If \p Context is passed, this
/// method is also able to traverse its children and dump them.
void dump(raw_ostream &OS, const SyntaxParsingContext *Context = nullptr,
unsigned Indent = 0) const;
static ParsedRawSyntaxNode null() {
return ParsedRawSyntaxNode{};