mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 22:02:23 +01:00
- Enhance toolchain/parse/node_kind.def with category x-macros (CARBON_PARSE_NODE_KIND_DECLARATION, CARBON_PARSE_NODE_KIND_EXPRESSION, CARBON_PARSE_NODE_KIND_PATTERN, CARBON_PARSE_NODE_KIND_STATEMENT) that default to CARBON_PARSE_NODE_KIND, keeping node_kind.def as the single source of truth without manual expansion divergence. - Decompose the monolithic toolchain/parse/extract.cpp translation unit into separate compilation units for declarations, expressions, patterns, and statements by expanding respective category x-macros. - Forward-declare Tree and TokenizedBuffer in parse and lex dump headers to reduce header inclusion depth. Assisted-by: Antigravity with Gemini
18 lines
725 B
C++
18 lines
725 B
C++
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
// Exceptions. See /LICENSE for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
#include "toolchain/parse/extract.h"
|
|
|
|
namespace Carbon::Parse {
|
|
|
|
#define CARBON_PARSE_NODE_KIND(KindName)
|
|
#define CARBON_PARSE_NODE_KIND_STATEMENT(KindName) \
|
|
template auto TreeAndSubtrees::TryExtractNodeFromChildren<KindName>( \
|
|
NodeId node_id, \
|
|
llvm::iterator_range<TreeAndSubtrees::SiblingIterator> children, \
|
|
ErrorBuilder * trace) const -> std::optional<KindName>;
|
|
#include "toolchain/parse/node_kind.def"
|
|
|
|
} // namespace Carbon::Parse
|