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

Method visitString

parser/parser.cc:1361–1370  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1359}
1360
1361std::any ParserVisitor::visitString(CelParser::StringContext* ctx) {
1362 auto status_or_value = cel::internal::ParseStringLiteral(ctx->tok->getText());
1363 if (!status_or_value.ok()) {
1364 return ExprToAny(factory_.ReportError(SourceRangeFromParserRuleContext(ctx),
1365 status_or_value.status().message()));
1366 }
1367 return ExprToAny(factory_.NewStringConst(
1368 factory_.NextId(SourceRangeFromParserRuleContext(ctx)),
1369 std::move(status_or_value).value()));
1370}
1371
1372std::any ParserVisitor::visitBytes(CelParser::BytesContext* ctx) {
1373 auto status_or_value = cel::internal::ParseBytesLiteral(ctx->tok->getText());

Callers

nothing calls this directly

Calls 10

ParseStringLiteralFunction · 0.85
ExprToAnyFunction · 0.85
getTextMethod · 0.80
messageMethod · 0.80
okMethod · 0.45
ReportErrorMethod · 0.45
NewStringConstMethod · 0.45
NextIdMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected