mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Rename parser dir to parse (#3178)
Continuing with #3070. Just a dir and file rename (mostly removing prefixes, although for parse_tree_fuzzer and parse_tree_file_test I'm dropping "tree" instead of "parse"). Everything in the parse dir should be marked as a move.
This commit is contained in:
@@ -21,8 +21,8 @@ cc_binary(
|
||||
"//common:error",
|
||||
"//toolchain/diagnostics:null_diagnostics",
|
||||
"//toolchain/lexer:tokenized_buffer",
|
||||
"//toolchain/parser:parse_node_kind",
|
||||
"//toolchain/parser:parse_tree",
|
||||
"//toolchain/parse:node_kind",
|
||||
"//toolchain/parse:tree",
|
||||
"//toolchain/source:source_buffer",
|
||||
"@llvm-project//clang-tools-extra/clangd:clangd_library",
|
||||
"@llvm-project//llvm:Support",
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
#include "clang-tools-extra/clangd/Protocol.h"
|
||||
#include "toolchain/diagnostics/null_diagnostics.h"
|
||||
#include "toolchain/lexer/tokenized_buffer.h"
|
||||
#include "toolchain/parser/parse_node_kind.h"
|
||||
#include "toolchain/parser/parse_tree.h"
|
||||
#include "toolchain/parse/node_kind.h"
|
||||
#include "toolchain/parse/tree.h"
|
||||
#include "toolchain/source/source_buffer.h"
|
||||
|
||||
namespace Carbon::LS {
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "clang-tools-extra/clangd/Transport.h"
|
||||
#include "clang-tools-extra/clangd/support/Function.h"
|
||||
#include "toolchain/lexer/tokenized_buffer.h"
|
||||
#include "toolchain/parser/parse_tree.h"
|
||||
#include "toolchain/parse/tree.h"
|
||||
#include "toolchain/source/source_buffer.h"
|
||||
|
||||
namespace Carbon::LS {
|
||||
|
||||
@@ -17,7 +17,7 @@ TARGETS = {
|
||||
"driver": "//toolchain/driver:driver_file_test",
|
||||
"lexer": "//toolchain/lexer:lexer_file_test",
|
||||
"lower": "//toolchain/lower:lower_file_test",
|
||||
"parser": "//toolchain/parser:parse_tree_file_test",
|
||||
"parse": "//toolchain/parse:parse_file_test",
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@ cc_library(
|
||||
"//common:check",
|
||||
"//common:ostream",
|
||||
"//common:vlog",
|
||||
"//toolchain/parser:parse_node_kind",
|
||||
"//toolchain/parser:parse_tree",
|
||||
"//toolchain/parse:node_kind",
|
||||
"//toolchain/parse:tree",
|
||||
"//toolchain/sem_ir:node",
|
||||
"@llvm-project//llvm:Support",
|
||||
],
|
||||
@@ -51,9 +51,9 @@ cc_library(
|
||||
"//toolchain/diagnostics:diagnostic_emitter",
|
||||
"//toolchain/diagnostics:diagnostic_kind",
|
||||
"//toolchain/lexer:tokenized_buffer",
|
||||
"//toolchain/parser:parse_node_kind",
|
||||
"//toolchain/parser:parse_tree",
|
||||
"//toolchain/parser:parse_tree_node_location_translator",
|
||||
"//toolchain/parse:node_kind",
|
||||
"//toolchain/parse:tree",
|
||||
"//toolchain/parse:tree_node_location_translator",
|
||||
"//toolchain/sem_ir:builtin_kind",
|
||||
"//toolchain/sem_ir:file",
|
||||
"//toolchain/sem_ir:node",
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include "toolchain/base/pretty_stack_trace_function.h"
|
||||
#include "toolchain/check/context.h"
|
||||
#include "toolchain/parser/parse_tree_node_location_translator.h"
|
||||
#include "toolchain/parse/tree_node_location_translator.h"
|
||||
#include "toolchain/sem_ir/file.h"
|
||||
|
||||
namespace Carbon::Check {
|
||||
@@ -46,7 +46,7 @@ auto CheckParseTree(const SemIR::File& builtin_ir,
|
||||
} \
|
||||
break; \
|
||||
}
|
||||
#include "toolchain/parser/parse_node_kind.def"
|
||||
#include "toolchain/parse/node_kind.def"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "common/ostream.h"
|
||||
#include "toolchain/diagnostics/diagnostic_emitter.h"
|
||||
#include "toolchain/lexer/tokenized_buffer.h"
|
||||
#include "toolchain/parser/parse_tree.h"
|
||||
#include "toolchain/parse/tree.h"
|
||||
#include "toolchain/sem_ir/file.h"
|
||||
|
||||
namespace Carbon::Check {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "toolchain/check/node_block_stack.h"
|
||||
#include "toolchain/diagnostics/diagnostic_kind.h"
|
||||
#include "toolchain/lexer/tokenized_buffer.h"
|
||||
#include "toolchain/parser/parse_node_kind.h"
|
||||
#include "toolchain/parse/node_kind.h"
|
||||
#include "toolchain/sem_ir/file.h"
|
||||
#include "toolchain/sem_ir/node.h"
|
||||
#include "toolchain/sem_ir/node_kind.h"
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "toolchain/check/declaration_name_stack.h"
|
||||
#include "toolchain/check/node_block_stack.h"
|
||||
#include "toolchain/check/node_stack.h"
|
||||
#include "toolchain/parser/parse_tree.h"
|
||||
#include "toolchain/parse/tree.h"
|
||||
#include "toolchain/sem_ir/file.h"
|
||||
#include "toolchain/sem_ir/node.h"
|
||||
|
||||
@@ -399,7 +399,7 @@ class Context {
|
||||
// Parse node handlers. Returns false for unrecoverable errors.
|
||||
#define CARBON_PARSE_NODE_KIND(Name) \
|
||||
auto Handle##Name(Context& context, Parse::Node parse_node)->bool;
|
||||
#include "toolchain/parser/parse_node_kind.def"
|
||||
#include "toolchain/parse/node_kind.def"
|
||||
|
||||
} // namespace Carbon::Check
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#define CARBON_TOOLCHAIN_CHECK_DECLARATION_NAME_STACK_H_
|
||||
|
||||
#include "llvm/ADT/SmallVector.h"
|
||||
#include "toolchain/parser/parse_tree.h"
|
||||
#include "toolchain/parse/tree.h"
|
||||
#include "toolchain/sem_ir/node.h"
|
||||
|
||||
namespace Carbon::Check {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
#include "toolchain/check/context.h"
|
||||
#include "toolchain/parser/parse_node_kind.h"
|
||||
#include "toolchain/parse/node_kind.h"
|
||||
#include "toolchain/sem_ir/node.h"
|
||||
#include "toolchain/sem_ir/node_kind.h"
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
#include "common/vlog.h"
|
||||
#include "llvm/ADT/SmallVector.h"
|
||||
#include "toolchain/parser/parse_node_kind.h"
|
||||
#include "toolchain/parser/parse_tree.h"
|
||||
#include "toolchain/parse/node_kind.h"
|
||||
#include "toolchain/parse/tree.h"
|
||||
#include "toolchain/sem_ir/node.h"
|
||||
|
||||
namespace Carbon::Check {
|
||||
|
||||
@@ -23,7 +23,7 @@ cc_library(
|
||||
"//toolchain/diagnostics:sorting_diagnostic_consumer",
|
||||
"//toolchain/lexer:tokenized_buffer",
|
||||
"//toolchain/lower",
|
||||
"//toolchain/parser:parse_tree",
|
||||
"//toolchain/parse:tree",
|
||||
"//toolchain/sem_ir:file",
|
||||
"//toolchain/sem_ir:formatter",
|
||||
"//toolchain/source:source_buffer",
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#include "toolchain/diagnostics/sorting_diagnostic_consumer.h"
|
||||
#include "toolchain/lexer/tokenized_buffer.h"
|
||||
#include "toolchain/lower/lower.h"
|
||||
#include "toolchain/parser/parse_tree.h"
|
||||
#include "toolchain/parse/tree.h"
|
||||
#include "toolchain/sem_ir/formatter.h"
|
||||
#include "toolchain/source/source_buffer.h"
|
||||
|
||||
|
||||
@@ -10,10 +10,10 @@ load("//testing/fuzzing:rules.bzl", "cc_fuzz_test")
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
cc_library(
|
||||
name = "parse_node_kind",
|
||||
srcs = ["parse_node_kind.cpp"],
|
||||
hdrs = ["parse_node_kind.h"],
|
||||
textual_hdrs = ["parse_node_kind.def"],
|
||||
name = "node_kind",
|
||||
srcs = ["node_kind.cpp"],
|
||||
hdrs = ["node_kind.h"],
|
||||
textual_hdrs = ["node_kind.def"],
|
||||
deps = [
|
||||
"//common:check",
|
||||
"//common:enum_base",
|
||||
@@ -21,29 +21,29 @@ cc_library(
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "parser_state",
|
||||
srcs = ["parser_state.cpp"],
|
||||
hdrs = ["parser_state.h"],
|
||||
textual_hdrs = ["parser_state.def"],
|
||||
name = "state",
|
||||
srcs = ["state.cpp"],
|
||||
hdrs = ["state.h"],
|
||||
textual_hdrs = ["state.def"],
|
||||
deps = ["//common:enum_base"],
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "parse_tree",
|
||||
name = "tree",
|
||||
srcs = [
|
||||
"parse_tree.cpp",
|
||||
"parser_context.cpp",
|
||||
"parser_context.h",
|
||||
"context.cpp",
|
||||
"context.h",
|
||||
"tree.cpp",
|
||||
] +
|
||||
# Glob handler files to avoid missing any.
|
||||
glob([
|
||||
"parser_handle_*.cpp",
|
||||
"handle_*.cpp",
|
||||
]),
|
||||
hdrs = ["parse_tree.h"],
|
||||
hdrs = ["tree.h"],
|
||||
deps = [
|
||||
":parse_node_kind",
|
||||
":parser_state",
|
||||
":node_kind",
|
||||
":precedence",
|
||||
":state",
|
||||
"//common:check",
|
||||
"//common:error",
|
||||
"//common:ostream",
|
||||
@@ -57,12 +57,12 @@ cc_library(
|
||||
)
|
||||
|
||||
cc_test(
|
||||
name = "parse_tree_test",
|
||||
name = "tree_test",
|
||||
size = "small",
|
||||
srcs = ["parse_tree_test.cpp"],
|
||||
srcs = ["tree_test.cpp"],
|
||||
deps = [
|
||||
":parse_node_kind",
|
||||
":parse_tree",
|
||||
":node_kind",
|
||||
":tree",
|
||||
"//common:ostream",
|
||||
"//testing/base:gtest_main",
|
||||
"//testing/base:test_raw_ostream",
|
||||
@@ -76,12 +76,12 @@ cc_test(
|
||||
)
|
||||
|
||||
cc_fuzz_test(
|
||||
name = "parse_tree_fuzzer",
|
||||
name = "parse_fuzzer",
|
||||
size = "small",
|
||||
srcs = ["parse_tree_fuzzer.cpp"],
|
||||
srcs = ["parse_fuzzer.cpp"],
|
||||
corpus = glob(["fuzzer_corpus/*"]),
|
||||
deps = [
|
||||
":parse_tree",
|
||||
":tree",
|
||||
"//common:check",
|
||||
"//toolchain/diagnostics:diagnostic_emitter",
|
||||
"//toolchain/diagnostics:null_diagnostics",
|
||||
@@ -91,9 +91,9 @@ cc_fuzz_test(
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "parse_tree_node_location_translator",
|
||||
hdrs = ["parse_tree_node_location_translator.h"],
|
||||
deps = [":parse_tree"],
|
||||
name = "tree_node_location_translator",
|
||||
hdrs = ["tree_node_location_translator.h"],
|
||||
deps = [":tree"],
|
||||
)
|
||||
|
||||
cc_library(
|
||||
@@ -120,8 +120,8 @@ cc_test(
|
||||
)
|
||||
|
||||
file_test(
|
||||
name = "parse_tree_file_test",
|
||||
srcs = ["parse_tree_file_test.cpp"],
|
||||
name = "parse_file_test",
|
||||
srcs = ["parse_file_test.cpp"],
|
||||
tests = glob(["testdata/**/*.carbon"]),
|
||||
deps = [
|
||||
"//toolchain/driver:driver_file_test_base",
|
||||
@@ -2,7 +2,7 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
#include "toolchain/parser/parser_context.h"
|
||||
#include "toolchain/parse/context.h"
|
||||
|
||||
#include <optional>
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
#include "llvm/ADT/STLExtras.h"
|
||||
#include "toolchain/lexer/token_kind.h"
|
||||
#include "toolchain/lexer/tokenized_buffer.h"
|
||||
#include "toolchain/parser/parse_node_kind.h"
|
||||
#include "toolchain/parser/parse_tree.h"
|
||||
#include "toolchain/parse/node_kind.h"
|
||||
#include "toolchain/parse/tree.h"
|
||||
|
||||
namespace Carbon::Parse {
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
#ifndef CARBON_TOOLCHAIN_PARSER_PARSER_CONTEXT_H_
|
||||
#define CARBON_TOOLCHAIN_PARSER_PARSER_CONTEXT_H_
|
||||
#ifndef CARBON_TOOLCHAIN_PARSE_CONTEXT_H_
|
||||
#define CARBON_TOOLCHAIN_PARSE_CONTEXT_H_
|
||||
|
||||
#include <optional>
|
||||
|
||||
@@ -11,10 +11,10 @@
|
||||
#include "common/vlog.h"
|
||||
#include "toolchain/lexer/token_kind.h"
|
||||
#include "toolchain/lexer/tokenized_buffer.h"
|
||||
#include "toolchain/parser/parse_node_kind.h"
|
||||
#include "toolchain/parser/parse_tree.h"
|
||||
#include "toolchain/parser/parser_state.h"
|
||||
#include "toolchain/parser/precedence.h"
|
||||
#include "toolchain/parse/node_kind.h"
|
||||
#include "toolchain/parse/precedence.h"
|
||||
#include "toolchain/parse/state.h"
|
||||
#include "toolchain/parse/tree.h"
|
||||
|
||||
namespace Carbon::Parse {
|
||||
|
||||
@@ -319,8 +319,8 @@ class Context {
|
||||
// `clang-format` has a bug with spacing around `->` returns in macros. See
|
||||
// https://bugs.llvm.org/show_bug.cgi?id=48320 for details.
|
||||
#define CARBON_PARSE_STATE(Name) auto Handle##Name(Context& context)->void;
|
||||
#include "toolchain/parser/parser_state.def"
|
||||
#include "toolchain/parse/state.def"
|
||||
|
||||
} // namespace Carbon::Parse
|
||||
|
||||
#endif // CARBON_TOOLCHAIN_PARSER_PARSER_CONTEXT_H_
|
||||
#endif // CARBON_TOOLCHAIN_PARSE_CONTEXT_H_
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user