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

Function DisplayParserError

parser/parser.cc:114–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112};
113
114std::string DisplayParserError(const cel::Source& source,
115 const ParserError& error) {
116 auto location =
117 source.GetLocation(error.range.begin).value_or(SourceLocation{});
118 return absl::StrCat(absl::StrFormat("ERROR: %s:%zu:%zu: %s",
119 source.description(), location.line,
120 // add one to the 0-based column
121 location.column + 1, error.message),
122 source.DisplayErrorLocation(location));
123}
124
125int32_t PositiveOrMax(int32_t value) {
126 return value >= 0 ? value : std::numeric_limits<int32_t>::max();

Callers 1

ErrorMessageMethod · 0.85

Calls 3

descriptionMethod · 0.80
DisplayErrorLocationMethod · 0.80
GetLocationMethod · 0.45

Tested by

no test coverage detected