Function repr_test_util::get_scalar_type_or_default[][src]

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 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 return Bool.
  • Else if starts with '"', will return String.
  • Else if contains '.', will return Float64.
  • Otherwise, returns Int64.