MCPcopy Create free account
hub / github.com/bytedance/bolt / parseDereference

Method parseDereference

bolt/expression/SingleSubfieldExtractor.cpp:128–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126}
127
128std::optional<std::pair<std::vector<const core::ITypedExpr*>, size_t>>
129SingleSubfieldExtractor::parseDereference(const core::ITypedExpr* expr) {
130 if (UNLIKELY(
131 expr == nullptr ||
132 expr->typedExprKind() != core::TypedExprKind::kDereference)) {
133 return std::nullopt;
134 }
135
136 auto deref = static_cast<const core::DereferenceTypedExpr*>(expr);
137 if (UNLIKELY(deref->inputs().empty() || deref->name().empty())) {
138 return std::nullopt;
139 }
140
141 auto childResult = parseSingleChain(deref->inputs()[0].get());
142 if (!childResult) {
143 return std::nullopt;
144 }
145
146 auto& [childChain, childDepth] = *childResult;
147 childChain.push_back(deref);
148 return std::make_pair(std::move(childChain), childDepth + 1);
149}
150
151std::optional<std::pair<std::vector<const core::ITypedExpr*>, size_t>>
152SingleSubfieldExtractor::parseCast(const core::ITypedExpr* expr) {

Callers

nothing calls this directly

Calls 5

typedExprKindMethod · 0.80
emptyMethod · 0.45
nameMethod · 0.45
getMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected