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

Class BlockInfo

eval/compiler/flat_expr_builder.cc:1797–1827  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1795 };
1796
1797 struct BlockInfo {
1798 // True if we are currently visiting the `cel.@block` node or any of its
1799 // children.
1800 bool in = false;
1801 // Pointer to the `cel.@block` node.
1802 const cel::Expr* expr = nullptr;
1803 // Pointer to the `cel.@block` bindings, that is the first argument to the
1804 // function.
1805 const cel::Expr* bindings = nullptr;
1806 // Set of pointers to the elements of `bindings` above.
1807 absl::flat_hash_set<const cel::Expr*> bindings_set;
1808 // Pointer to the `cel.@block` bound expression, that is the second argument
1809 // to the function.
1810 const cel::Expr* bound = nullptr;
1811 // The number of entries in the `cel.@block`.
1812 size_t size = 0;
1813 // Starting slot index for `cel.@block`. We occupy he slot indices `index`
1814 // through `index + size + (var_size * 2)`.
1815 size_t index = 0;
1816 // The total number of slots needed for evaluating the bound expressions.
1817 size_t slot_count = 0;
1818 // The current slot index we are processing, any index references must be
1819 // less than this to be valid.
1820 size_t current_index = 0;
1821 // Pointer to the current `cel.@block` being processed, that is one of the
1822 // elements within the first argument.
1823 const cel::Expr* current_binding = nullptr;
1824 // Mapping between block indices and their subexpressions, fixed size with
1825 // exactly `size` elements. Unprocessed indices are set to `-1`.
1826 std::vector<int> subexpressions;
1827 };
1828
1829 bool PlanningSuppressed() const {
1830 return resume_from_suppressed_branch_ != nullptr;

Callers 1

PreVisitCallMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected