Refactor YAML handling to use the llvm::yaml API. (#3337)

Provides an adapter for the llvm::yaml API because it otherwise needs a
bunch of const/non-const definitions, and the traits are difficult to
diagnose issues with. The current approach is pretty simple to use, even
if it's not super efficient (which, yaml output is more of a debugging
thing so I'm not really expecting it to be an issue).

Changes the format of yaml output to provide more index information,
just as reminders when seeing something like `node+0`. Note this would
create more churn in deltas if we were reliant on the output yaml in
tests, but we aren't so it should be okay.
This commit is contained in:
Jon Ross-Perkins
2023-10-26 18:50:30 +00:00
committed by GitHub
parent 387a1711af
commit 3af7eb2672
17 changed files with 523 additions and 391 deletions
+1 -1
View File
@@ -1057,7 +1057,7 @@ TEST_F(LexerTest, DiagnosticUnrecognizedChar) {
Lex("\b", consumer);
}
TEST_F(LexerTest, PrintingAsYaml) {
TEST_F(LexerTest, PrintingOutputYaml) {
// Test that we can parse this into YAML and verify line and indent data.
auto buffer = Lex("\n ;\n\n\n; ;\n\n\n\n\n\n\n\n\n\n\n");
ASSERT_FALSE(buffer.has_errors());