(&mut self, ctx: &BytesContext<'_>)
| 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() { |
nothing calls this directly
no test coverage detected