Clean up a few details of lex yaml printing (#4845)

- Escape dumped token strings (what got me here)
- Change the quoting from backticks to quotes
- Also add a `FormatEscaped` helper function for this, updating other
`.write_escaped` uses
This commit is contained in:
Jon Ross-Perkins
2025-01-24 21:52:02 +00:00
committed by GitHub
parent 22c0198835
commit b06fcc97f6
24 changed files with 255 additions and 247 deletions
+1 -3
View File
@@ -27,9 +27,7 @@ static auto GenerateCppIncludesHeaderCode(
std::string code;
llvm::raw_string_ostream code_stream(code);
for (const auto& [path, _] : imports) {
code_stream << "#include \"";
code_stream.write_escaped(path);
code_stream << "\"\n";
code_stream << "#include \"" << FormatEscaped(path) << "\"\n";
}
return code;
}