Add functions for each Value case (#9736)

# Description
This PR ensures functions exist to extract and create each and every
`Value` case. It also renames `Value::boolean` to `Value::bool` to match
`Value::test_bool`, `Value::as_bool`, and `Value::Bool`. Similarly,
`Value::as_integer` was renamed to `Value::as_int` to be consistent with
`Value::int`, `Value::test_int`, and `Value::Int`. These two renames can
be undone if necessary.

# User-Facing Changes
No user facing changes, but two public functions were renamed which may
affect downstream dependents.
This commit is contained in:
Ian Manske
2023-07-21 13:20:33 +00:00
committed by GitHub
parent 0b1e368cea
commit 7e1b922ea7
30 changed files with 413 additions and 216 deletions

View File

@ -246,7 +246,7 @@ fn heuristic_parse(
Vec::new(),
))
} else {
Ok(PipelineData::Value(Value::boolean(false, span), None))
Ok(PipelineData::Value(Value::bool(false, span), None))
}
}
}
@ -291,7 +291,7 @@ fn heuristic_parse_file(
Vec::new(),
))
} else {
Ok(PipelineData::Value(Value::boolean(false, call.head), None))
Ok(PipelineData::Value(Value::bool(false, call.head), None))
}
}
}
@ -337,10 +337,10 @@ fn parse_module(
Vec::new(),
))
} else {
Ok(PipelineData::Value(Value::boolean(false, new_span), None))
Ok(PipelineData::Value(Value::bool(false, new_span), None))
}
} else {
Ok(PipelineData::Value(Value::boolean(true, new_span), None))
Ok(PipelineData::Value(Value::bool(true, new_span), None))
}
}
@ -370,10 +370,10 @@ fn parse_script(
Vec::new(),
))
} else {
Ok(PipelineData::Value(Value::boolean(false, span), None))
Ok(PipelineData::Value(Value::bool(false, span), None))
}
} else {
Ok(PipelineData::Value(Value::boolean(true, span), None))
Ok(PipelineData::Value(Value::bool(true, span), None))
}
}