(&mut self, ctx: &DoubleContext<'_>)
| 962 | } |
| 963 | |
| 964 | fn visit_Double(&mut self, ctx: &DoubleContext<'_>) -> Self::Return { |
| 965 | let string = ctx.get_text(); |
| 966 | if let Some(token) = ctx.tok.as_ref() { |
| 967 | match string.parse::<f64>() { |
| 968 | Ok(d) if d.is_finite() => self |
| 969 | .helper |
| 970 | .next_expr(token, Expr::Literal(LiteralValue::Double(d.into()))), |
| 971 | Err(e) => self.report_error(token, Some(e), "invalid double literal"), |
| 972 | _ => self.report_error(token, None::<ParseError>, "invalid double literal"), |
| 973 | } |
| 974 | } else { |
| 975 | self.report_error::<ParseError, _>( |
| 976 | &ctx.start(), |
| 977 | None::<ParseError>, |
| 978 | "Incomplete double!", |
| 979 | ) |
| 980 | } |
| 981 | } |
| 982 | |
| 983 | fn visit_String(&mut self, ctx: &StringContext<'_>) -> Self::Return { |
| 984 | if let Some(token) = ctx.tok.as_deref() { |
nothing calls this directly
no test coverage detected