Functional changes in the dump:
- Surround Leaf tokens with '
- Append Node dumps with NodeRole information, except for unknown roles
Non-functional changes:
- ::dumpTokens(llvm::raw_ostream, ArrayRef<syntax::Token>, const SourceManager &SM) always received as parameter a syntax::Token * pointing to Leaf::token(). Changed the function to dumpLeaf(llvm::raw_ostream, syntax::Leaf *, const SourceManager&)
- dumpTree acted on a Node, rename to dumpNode
- use SourceManager in parameters for dump instead of Arena
TODO:
Adapt all the tree dumps in TreeTest.cpp to this new format.
clang-format: please reformat the code
- R += std::string(formatv( - "- '{0}' covers '{1}'+{2} tokens\n", It->second->kind(), - It->first->text(A.sourceManager()), CoveredTokens)); + R += std::string( + formatv("- '{0}' covers '{1}'+{2} tokens\n", It->second->kind(), + It->first->text(A.sourceManager()), CoveredTokens));