mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 12:11:04 +01:00
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:
@@ -9,7 +9,7 @@
|
||||
#include "toolchain/diagnostics/null_diagnostics.h"
|
||||
#include "toolchain/lex/lex.h"
|
||||
#include "toolchain/parse/node_kind.h"
|
||||
#include "toolchain/parse/tree.h"
|
||||
#include "toolchain/parse/parse.h"
|
||||
#include "toolchain/source/source_buffer.h"
|
||||
|
||||
namespace Carbon::LS {
|
||||
@@ -101,7 +101,7 @@ void LanguageServer::OnDocumentSymbol(
|
||||
|
||||
auto buf = SourceBuffer::CreateFromFile(vfs, file, NullDiagnosticConsumer());
|
||||
auto lexed = Lex::Lex(value_stores, *buf, NullDiagnosticConsumer());
|
||||
auto parsed = Parse::Tree::Parse(lexed, NullDiagnosticConsumer(), nullptr);
|
||||
auto parsed = Parse::Parse(lexed, NullDiagnosticConsumer(), nullptr);
|
||||
std::vector<clang::clangd::DocumentSymbol> result;
|
||||
for (const auto& node : parsed.postorder()) {
|
||||
clang::clangd::SymbolKind symbol_kind;
|
||||
|
||||
Reference in New Issue
Block a user