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

Method visit_Double

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

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 4

DoubleClass · 0.85
next_exprMethod · 0.80
report_errorMethod · 0.80
startMethod · 0.80

Tested by

no test coverage detected