mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 07:14:46 +00:00
groundwork for RoseTree
This commit is contained in:
parent
a4d7e809d2
commit
513d7cd78f
9 changed files with 304 additions and 29 deletions
|
@ -602,7 +602,21 @@ fn to_relevant_branch_help<'a>(
|
|||
}
|
||||
}
|
||||
Wrapped::RecordOrSingleTagUnion => {
|
||||
todo!("this should need a special index, right?")
|
||||
let sub_positions = arguments.into_iter().enumerate().map(
|
||||
|(index, (pattern, _))| {
|
||||
(
|
||||
Path::Index {
|
||||
index: index as u64,
|
||||
tag_id,
|
||||
path: Box::new(path.clone()),
|
||||
},
|
||||
Guard::NoGuard,
|
||||
pattern,
|
||||
)
|
||||
},
|
||||
);
|
||||
start.extend(sub_positions);
|
||||
start.extend(end);
|
||||
}
|
||||
Wrapped::MultiTagUnion => {
|
||||
let sub_positions = arguments.into_iter().enumerate().map(
|
||||
|
@ -1035,6 +1049,10 @@ fn path_to_expr_help<'a>(
|
|||
|
||||
match variant {
|
||||
NonRecursive(layouts) | Recursive(layouts) => layouts[*tag_id as usize],
|
||||
NonNullableUnwrapped(fields) => {
|
||||
debug_assert_eq!(*tag_id, 0);
|
||||
fields
|
||||
}
|
||||
NullableWrapped {
|
||||
nullable_id,
|
||||
other_tags: layouts,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue