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

Method visit_Bytes

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

Source from the content-addressed store, hash-verified

1002 }
1003
1004 fn visit_Bytes(&mut self, ctx: &BytesContext<'_>) -> Self::Return {
1005 if let Some(token) = ctx.tok.as_deref() {
1006 let string = ctx.get_text();
1007 match parse::parse_bytes(&string[2..string.len() - 1]) {
1008 Ok(bytes) => self
1009 .helper
1010 .next_expr(token, Expr::Literal(LiteralValue::Bytes(bytes.into()))),
1011 Err(e) => {
1012 self.report_error::<ParseError, _>(
1013 token,
1014 None,
1015 format!("invalid bytes literal: {e:?}"),
1016 );
1017 IdedExpr::default()
1018 }
1019 }
1020 } else {
1021 self.report_error::<ParseError, _>(
1022 &ctx.start(),
1023 None::<ParseError>,
1024 "Incomplete bytes!",
1025 )
1026 }
1027 }
1028
1029 fn visit_BoolTrue(&mut self, ctx: &BoolTrueContext<'_>) -> Self::Return {
1030 match ctx.tok.as_deref() {

Callers

nothing calls this directly

Calls 4

parse_bytesFunction · 0.85
BytesClass · 0.85
next_exprMethod · 0.80
startMethod · 0.80

Tested by

no test coverage detected