mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
implement mono / lowering for tuples
This commit is contained in:
parent
65f8bb3d0d
commit
5a6be05ead
42 changed files with 1773 additions and 290 deletions
|
@ -5,7 +5,7 @@ use crate::expr::Expr::{self, *};
|
|||
use crate::expr::{
|
||||
ClosureData, DeclarationTag, Declarations, FunctionDef, OpaqueWrapFunctionData, WhenBranch,
|
||||
};
|
||||
use crate::pattern::{Pattern, RecordDestruct};
|
||||
use crate::pattern::{Pattern, RecordDestruct, TupleDestruct};
|
||||
|
||||
use roc_module::symbol::{Interns, ModuleId, Symbol};
|
||||
|
||||
|
@ -335,7 +335,6 @@ fn expr<'a>(c: &Ctx, p: EPrec, f: &'a Arena<'a>, e: &'a Expr) -> DocBuilder<'a,
|
|||
f.text(format!("@{}", opaque_name.as_str(c.interns)))
|
||||
}
|
||||
RecordAccessor(_) => todo!(),
|
||||
TupleAccessor(_) => todo!(),
|
||||
RecordUpdate {
|
||||
symbol, updates, ..
|
||||
} => f
|
||||
|
@ -505,6 +504,19 @@ fn pattern<'a>(
|
|||
)
|
||||
.append(f.text("}"))
|
||||
.group(),
|
||||
TupleDestructure { destructs, .. } => f
|
||||
.text("(")
|
||||
.append(
|
||||
f.intersperse(
|
||||
destructs
|
||||
.iter()
|
||||
.map(|l| &l.value)
|
||||
.map(|TupleDestruct { typ: (_, p), .. }| pattern(c, Free, f, &p.value)),
|
||||
f.text(", "),
|
||||
),
|
||||
)
|
||||
.append(f.text(")"))
|
||||
.group(),
|
||||
List { .. } => todo!(),
|
||||
NumLiteral(_, n, _, _) | IntLiteral(_, _, n, _, _) | FloatLiteral(_, _, n, _, _) => {
|
||||
f.text(&**n)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue