Commit ad577629 authored by Georg Neis's avatar Georg Neis Committed by Commit Bot

[ast] Make AstPrinter print a block's labels.

Also make printing of an incomplete AST more robust.

Change-Id: I56636890deb6e38882a3f8206aff7cde3e4bab60
Reviewed-on: https://chromium-review.googlesource.com/1168498Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55009}
parent a6e0a0b7
......@@ -758,8 +758,10 @@ void AstPrinter::PrintLabelsIndented(ZonePtrList<const AstRawString>* labels) {
void AstPrinter::PrintIndentedVisit(const char* s, AstNode* node) {
IndentedScope indent(this, s, node->position());
Visit(node);
if (node != nullptr) {
IndentedScope indent(this, s, node->position());
Visit(node);
}
}
......@@ -826,6 +828,7 @@ void AstPrinter::VisitBlock(Block* node) {
const char* block_txt =
node->ignore_completion_value() ? "BLOCK NOCOMPLETIONS" : "BLOCK";
IndentedScope indent(this, block_txt, node->position());
PrintLabelsIndented(node->labels());
PrintStatements(node->statements());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment