mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
Semantic layouts for tuples
This commit is contained in:
parent
c06ffc434b
commit
43d4135dc8
2 changed files with 11 additions and 1 deletions
|
@ -8,6 +8,7 @@
|
|||
pub enum SemanticRepr<'a> {
|
||||
None,
|
||||
Record(SemaRecord<'a>),
|
||||
Tuple(SemaTuple),
|
||||
}
|
||||
|
||||
impl<'a> SemanticRepr<'a> {
|
||||
|
@ -16,9 +17,18 @@ impl<'a> SemanticRepr<'a> {
|
|||
pub(super) fn record(fields: &'a [&'a str]) -> Self {
|
||||
Self::Record(SemaRecord { fields })
|
||||
}
|
||||
|
||||
pub(super) fn tuple(size: usize) -> Self {
|
||||
Self::Tuple(SemaTuple { size })
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
|
||||
pub struct SemaRecord<'a> {
|
||||
pub fields: &'a [&'a str],
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
|
||||
pub struct SemaTuple {
|
||||
pub size: usize,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue