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

Method GetLocation

common/source.cc:479–487  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

477} // namespace common_internal
478
479absl::optional<SourceLocation> Source::GetLocation(
480 SourcePosition position) const {
481 if (auto line_and_offset = FindLine(position);
482 ABSL_PREDICT_TRUE(line_and_offset.has_value())) {
483 return SourceLocation{line_and_offset->first,
484 position - line_and_offset->second};
485 }
486 return absl::nullopt;
487}
488
489absl::optional<SourcePosition> Source::GetPosition(
490 const SourceLocation& location) const {

Callers 2

TESTFunction · 0.45
source_test.ccFile · 0.45

Calls 1

has_valueMethod · 0.45

Tested by 1

TESTFunction · 0.36