MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / parse_domain_bound

Method parse_domain_bound

nodedb-sql/src/parser/array_stmt/parse_impl.rs:243–255  ·  view source on GitHub ↗
(&mut self, dtype: ArrayDimType)

Source from the content-addressed store, hash-verified

241 }
242
243 fn parse_domain_bound(&mut self, dtype: ArrayDimType) -> Result<ArrayDomainBound> {
244 match dtype {
245 ArrayDimType::Int64 => Ok(ArrayDomainBound::Int64(self.expect_int()?)),
246 ArrayDimType::TimestampMs => Ok(ArrayDomainBound::TimestampMs(self.expect_int()?)),
247 ArrayDimType::Float64 => Ok(ArrayDomainBound::Float64(
248 self.expect_float_or_int_as_f64()?,
249 )),
250 ArrayDimType::String => match self.bump().map(|t| &t.tok) {
251 Some(Tok::Str(s)) => Ok(ArrayDomainBound::String(s.clone())),
252 other => Err(self.err(format!("expected string literal, got {other:?}"))),
253 },
254 }
255 }
256
257 fn parse_attr(&mut self) -> Result<ArrayAttrAst> {
258 let name = self.expect_ident()?;

Callers 1

parse_dimMethod · 0.80

Calls 5

expect_intMethod · 0.80
bumpMethod · 0.45
cloneMethod · 0.45
errMethod · 0.45

Tested by

no test coverage detected