MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / PostVisitIdent

Method PostVisitIdent

common/ast_rewrite_test.cc:507–520  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

505 }
506
507 void PostVisitIdent(const Expr& expr, const IdentExpr& ident) override {
508 if (path_.size() >= 3) {
509 if (ident.name() == "com") {
510 const Expr* p1 = path_.at(path_.size() - 2);
511 const Expr* p2 = path_.at(path_.size() - 3);
512
513 if (p1->has_select_expr() && p1->select_expr().field() == "google" &&
514 p2->has_select_expr() &&
515 p2->select_expr().field() == "Identifier") {
516 target_ = p2->id();
517 }
518 }
519 }
520 }
521
522 void TraversalStackUpdate(absl::Span<const Expr*> path) override {
523 path_ = path;

Callers

nothing calls this directly

Calls 6

atMethod · 0.80
has_select_exprMethod · 0.80
sizeMethod · 0.45
nameMethod · 0.45
fieldMethod · 0.45
idMethod · 0.45

Tested by

no test coverage detected