MCPcopy Create free account
hub / github.com/cel-rust/cel-rust / visit_String

Method visit_String

cel/src/parser/parser.rs:983–1002  ·  view source on GitHub ↗
(&mut self, ctx: &StringContext<'_>)

Source from the content-addressed store, hash-verified

981 }
982
983 fn visit_String(&mut self, ctx: &StringContext<'_>) -> Self::Return {
984 if let Some(token) = ctx.tok.as_deref() {
985 match parse::parse_string(&ctx.get_text()) {
986 Ok(string) => self
987 .helper
988 .next_expr(token, Expr::Literal(LiteralValue::String(string.into()))),
989 Err(e) => self.report_error::<ParseError, _>(
990 token,
991 None,
992 format!("invalid string literal: {e:?}"),
993 ),
994 }
995 } else {
996 self.report_error::<ParseError, _>(
997 &ctx.start(),
998 None::<ParseError>,
999 "Incomplete string!",
1000 )
1001 }
1002 }
1003
1004 fn visit_Bytes(&mut self, ctx: &BytesContext<'_>) -> Self::Return {
1005 if let Some(token) = ctx.tok.as_deref() {

Callers

nothing calls this directly

Calls 4

parse_stringFunction · 0.85
StringClass · 0.85
next_exprMethod · 0.80
startMethod · 0.80

Tested by

no test coverage detected