Skip to content

Commit 32fd9a5

Browse files
jnthntatumcopybara-github
authored andcommitted
Clean up remaining references to old aliases for AST metadata types.
Delete common/ast/expr.h PiperOrigin-RevId: 803166485
1 parent 3b3d579 commit 32fd9a5

File tree

6 files changed

+23
-94
lines changed

6 files changed

+23
-94
lines changed

checker/internal/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ cc_test(
202202
"//common:ast",
203203
"//common:decl",
204204
"//common:type",
205-
"//common/ast:expr",
206205
"//internal:testing",
207206
"//internal:testing_descriptor_pool",
208207
"@com_google_absl//absl/status",

checker/internal/type_checker_builder_impl_test.cc

Lines changed: 23 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include "checker/type_checker.h"
2929
#include "checker/validation_result.h"
3030
#include "common/ast.h"
31-
#include "common/ast/expr.h"
3231
#include "common/decl.h"
3332
#include "common/type.h"
3433
#include "common/type_introspector.h"
@@ -71,52 +70,42 @@ TEST_P(ContextDeclsFieldsDefinedTest, ContextDeclsFieldsDefined) {
7170
INSTANTIATE_TEST_SUITE_P(
7271
TestAllTypes, ContextDeclsFieldsDefinedTest,
7372
testing::Values(
74-
ContextDeclsTestCase{"single_int64",
75-
TypeSpec(ast_internal::PrimitiveType::kInt64)},
76-
ContextDeclsTestCase{"single_uint32",
77-
TypeSpec(ast_internal::PrimitiveType::kUint64)},
78-
ContextDeclsTestCase{"single_double",
79-
TypeSpec(ast_internal::PrimitiveType::kDouble)},
80-
ContextDeclsTestCase{"single_string",
81-
TypeSpec(ast_internal::PrimitiveType::kString)},
82-
ContextDeclsTestCase{"single_any",
83-
TypeSpec(ast_internal::WellKnownType::kAny)},
73+
ContextDeclsTestCase{"single_int64", TypeSpec(PrimitiveType::kInt64)},
74+
ContextDeclsTestCase{"single_uint32", TypeSpec(PrimitiveType::kUint64)},
75+
ContextDeclsTestCase{"single_double", TypeSpec(PrimitiveType::kDouble)},
76+
ContextDeclsTestCase{"single_string", TypeSpec(PrimitiveType::kString)},
77+
ContextDeclsTestCase{"single_any", TypeSpec(WellKnownTypeSpec::kAny)},
8478
ContextDeclsTestCase{"single_duration",
85-
TypeSpec(ast_internal::WellKnownType::kDuration)},
86-
ContextDeclsTestCase{"single_bool_wrapper",
87-
TypeSpec(ast_internal::PrimitiveTypeWrapper(
88-
ast_internal::PrimitiveType::kBool))},
79+
TypeSpec(WellKnownTypeSpec::kDuration)},
80+
ContextDeclsTestCase{
81+
"single_bool_wrapper",
82+
TypeSpec(PrimitiveTypeWrapper(PrimitiveType::kBool))},
8983
ContextDeclsTestCase{
9084
"list_value",
91-
TypeSpec(ast_internal::ListType(
92-
std::make_unique<TypeSpec>(ast_internal::DynamicType())))},
85+
TypeSpec(ListTypeSpec(std::make_unique<TypeSpec>(DynTypeSpec())))},
9386
ContextDeclsTestCase{
9487
"standalone_message",
95-
TypeSpec(ast_internal::MessageType(
88+
TypeSpec(MessageTypeSpec(
9689
"cel.expr.conformance.proto3.TestAllTypes.NestedMessage"))},
9790
ContextDeclsTestCase{"standalone_enum",
98-
TypeSpec(ast_internal::PrimitiveType::kInt64)},
99-
ContextDeclsTestCase{
100-
"repeated_bytes",
101-
TypeSpec(ast_internal::ListType(std::make_unique<TypeSpec>(
102-
ast_internal::PrimitiveType::kBytes)))},
91+
TypeSpec(PrimitiveType::kInt64)},
92+
ContextDeclsTestCase{"repeated_bytes",
93+
TypeSpec(ListTypeSpec(std::make_unique<TypeSpec>(
94+
PrimitiveType::kBytes)))},
10395
ContextDeclsTestCase{
10496
"repeated_nested_message",
105-
TypeSpec(ast_internal::ListType(std::make_unique<
106-
TypeSpec>(ast_internal::MessageType(
97+
TypeSpec(ListTypeSpec(std::make_unique<TypeSpec>(MessageTypeSpec(
10798
"cel.expr.conformance.proto3.TestAllTypes.NestedMessage"))))},
10899
ContextDeclsTestCase{
109100
"map_int32_timestamp",
110-
TypeSpec(ast_internal::MapType(
111-
std::make_unique<TypeSpec>(ast_internal::PrimitiveType::kInt64),
112-
std::make_unique<TypeSpec>(
113-
ast_internal::WellKnownType::kTimestamp)))},
101+
TypeSpec(MapTypeSpec(
102+
std::make_unique<TypeSpec>(PrimitiveType::kInt64),
103+
std::make_unique<TypeSpec>(WellKnownTypeSpec::kTimestamp)))},
114104
ContextDeclsTestCase{
115105
"single_struct",
116-
TypeSpec(ast_internal::MapType(
117-
std::make_unique<TypeSpec>(
118-
ast_internal::PrimitiveType::kString),
119-
std::make_unique<TypeSpec>(ast_internal::DynamicType())))}));
106+
TypeSpec(
107+
MapTypeSpec(std::make_unique<TypeSpec>(PrimitiveType::kString),
108+
std::make_unique<TypeSpec>(DynTypeSpec())))}));
120109

121110
TEST(ContextDeclsTest, ErrorOnDuplicateContextDeclaration) {
122111
TypeCheckerBuilderImpl builder(internal::GetSharedTestingDescriptorPool(),
@@ -323,8 +312,7 @@ TEST(TypeCheckerBuilderImplTest, ReplaceVariable) {
323312

324313
const auto& checked_ast = *result.GetAst();
325314

326-
EXPECT_EQ(checked_ast.GetReturnType(),
327-
TypeSpec(ast_internal::PrimitiveType::kString));
315+
EXPECT_EQ(checked_ast.GetReturnType(), TypeSpec(PrimitiveType::kString));
328316
}
329317

330318
} // namespace

common/ast/BUILD

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,6 @@ cc_test(
7373
],
7474
)
7575

76-
cc_library(
77-
name = "expr",
78-
hdrs = [
79-
"expr.h",
80-
],
81-
deps = [
82-
":metadata",
83-
],
84-
)
85-
8676
cc_library(
8777
name = "source_info_proto",
8878
srcs = ["source_info_proto.cc"],

common/ast/expr.h

Lines changed: 0 additions & 46 deletions
This file was deleted.

parser/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ cc_library(
3939
":source_factory",
4040
"//common:ast",
4141
"//common:constant",
42-
"//common:expr",
4342
"//common:expr_factory",
4443
"//common:operators",
4544
"//common:source",

parser/parser.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757
#include "common/ast/expr_proto.h"
5858
#include "common/ast/source_info_proto.h"
5959
#include "common/constant.h"
60-
#include "common/expr.h"
6160
#include "common/expr_factory.h"
6261
#include "common/operators.h"
6362
#include "common/source.h"

0 commit comments

Comments
 (0)