2727#include " base/builtins.h"
2828#include " base/type_provider.h"
2929#include " common/ast/ast_impl.h"
30- #include " common/ast/expr.h"
30+ #include " common/constant.h"
31+ #include " common/expr.h"
3132#include " common/kind.h"
3233#include " common/value.h"
3334#include " eval/compiler/flat_expr_builder_extensions.h"
@@ -45,15 +46,15 @@ namespace cel::runtime_internal {
4546
4647namespace {
4748
49+ using ::cel::CallExpr;
50+ using ::cel::ComprehensionExpr;
51+ using ::cel::Constant;
52+ using ::cel::Expr;
53+ using ::cel::IdentExpr;
54+ using ::cel::ListExpr;
55+ using ::cel::SelectExpr;
56+ using ::cel::StructExpr;
4857using ::cel::ast_internal::AstImpl;
49- using ::cel::ast_internal::Call;
50- using ::cel::ast_internal::Comprehension;
51- using ::cel::ast_internal::Constant;
52- using ::cel::ast_internal::CreateList;
53- using ::cel::ast_internal::CreateStruct;
54- using ::cel::ast_internal::Expr;
55- using ::cel::ast_internal::Ident;
56- using ::cel::ast_internal::Select;
5758using ::cel::builtin::kAnd ;
5859using ::cel::builtin::kOr ;
5960using ::cel::builtin::kTernary ;
@@ -117,13 +118,13 @@ absl::Status ConstantFoldingExtension::OnPreVisit(PlannerContext& context,
117118 const Expr& node) {
118119 struct IsConstVisitor {
119120 IsConst operator ()(const Constant&) { return IsConst::kConditional ; }
120- IsConst operator ()(const Ident &) { return IsConst::kNonConst ; }
121- IsConst operator ()(const Comprehension &) {
121+ IsConst operator ()(const IdentExpr &) { return IsConst::kNonConst ; }
122+ IsConst operator ()(const ComprehensionExpr &) {
122123 // Not yet supported, need to identify whether range and
123124 // iter vars are compatible with const folding.
124125 return IsConst::kNonConst ;
125126 }
126- IsConst operator ()(const CreateStruct & create_struct) {
127+ IsConst operator ()(const StructExpr & create_struct) {
127128 return IsConst::kNonConst ;
128129 }
129130 IsConst operator ()(const cel::MapExpr& map_expr) {
@@ -136,7 +137,7 @@ absl::Status ConstantFoldingExtension::OnPreVisit(PlannerContext& context,
136137 }
137138 return IsConst::kConditional ;
138139 }
139- IsConst operator ()(const CreateList & create_list) {
140+ IsConst operator ()(const ListExpr & create_list) {
140141 if (create_list.elements ().empty ()) {
141142 // TODO: Don't fold for empty list to allow comprehension
142143 // list append optimization.
@@ -145,13 +146,13 @@ absl::Status ConstantFoldingExtension::OnPreVisit(PlannerContext& context,
145146 return IsConst::kConditional ;
146147 }
147148
148- IsConst operator ()(const Select &) { return IsConst::kConditional ; }
149+ IsConst operator ()(const SelectExpr &) { return IsConst::kConditional ; }
149150
150151 IsConst operator ()(const cel::UnspecifiedExpr&) {
151152 return IsConst::kNonConst ;
152153 }
153154
154- IsConst operator ()(const Call & call) {
155+ IsConst operator ()(const CallExpr & call) {
155156 // Short Circuiting operators not yet supported.
156157 if (call.function () == kAnd || call.function () == kOr ||
157158 call.function () == kTernary ) {
0 commit comments