Split Parse out to its own target. (#3556)

This is mirroring the structure of codegen/codegen.h, lower/lower.h, and
check/check.h. I recently did lex/lex.h, so parse/parse.h is the last.
Now, the directory's main API file is eponymous with the directory.

I could've used a friend function to avoid making the Tree constructor
public, but in other places we make less use of `friend`, just leaving
things public. This felt more consistent, and simple because it only
affects the constructor.
This commit is contained in:
Jon Ross-Perkins
2024-01-03 19:44:05 +00:00
committed by GitHub
parent 62973f26d7
commit c8b30d3eec
12 changed files with 140 additions and 89 deletions
+2 -2
View File
@@ -9,7 +9,7 @@
#include "toolchain/base/value_store.h"
#include "toolchain/diagnostics/null_diagnostics.h"
#include "toolchain/lex/lex.h"
#include "toolchain/parse/tree.h"
#include "toolchain/parse/parse.h"
namespace Carbon::Testing {
@@ -40,7 +40,7 @@ extern "C" int LLVMFuzzerTestOneInput(const unsigned char* data,
// Now parse it into a tree. Note that parsing will (when asserts are enabled)
// walk the entire tree to verify it so we don't have to do that here.
Parse::Tree::Parse(tokens, NullDiagnosticConsumer(), /*vlog_stream=*/nullptr);
Parse::Parse(tokens, NullDiagnosticConsumer(), /*vlog_stream=*/nullptr);
return 0;
}