Merge branch 'trunk' into store-bool-closure-as-unit

This commit is contained in:
Richard Feldman 2021-08-14 16:47:42 -04:00 committed by GitHub
commit bb7726b0e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 315 additions and 342 deletions

View file

@ -1519,7 +1519,10 @@ impl UnionTags {
)
}
fn from_slices(tag_names: SubsSlice<TagName>, variables: SubsSlice<VariableSubsSlice>) -> Self {
pub fn from_slices(
tag_names: SubsSlice<TagName>,
variables: SubsSlice<VariableSubsSlice>,
) -> Self {
debug_assert_eq!(tag_names.len(), variables.len());
Self {
@ -1578,6 +1581,16 @@ impl UnionTags {
)
}
pub fn tag_without_arguments(subs: &mut Subs, tag_name: TagName) -> Self {
subs.tag_names.push(tag_name);
Self {
length: 1,
tag_names_start: (subs.tag_names.len() - 1) as u32,
variables_start: 0,
}
}
pub fn insert_slices_into_subs<I>(subs: &mut Subs, input: I) -> Self
where
I: IntoIterator<Item = (TagName, VariableSubsSlice)>,