Function mz_repr_test_util::get_scalar_type_or_default
source · pub fn get_scalar_type_or_default<I>(
litval: &str,
scalar_type_stream: &mut I
) -> Result<ScalarType, String>where
I: Iterator<Item = TokenTree>,
Expand description
Parses ScalarType
from scalar_type_stream
or infers it from litval
See mz_lowertest::to_json for the syntax for specifying a ScalarType
.
If scalar_type_stream
is empty, will attempt to guess a ScalarType
for
the literal:
- If
litval
is “true”, “false”, or “null”, will returnBool
. - Else if starts with
'"'
, will return String. - Else if contains
'.'
, will return Float64. - Otherwise, returns Int64.