Switch TablConstr to BoundedSeparated

This commit is contained in:
Joscha 2022-11-21 23:54:40 +01:00
parent e3fa3500d4
commit 0e9cfd67c2
6 changed files with 82 additions and 102 deletions

View file

@ -126,8 +126,6 @@ impl HasSpan for TableLitElem {
}
/// `'{ a, foo: b }`
///
/// Structure: `'{ s0 elems s1 }`
#[derive(Debug, Clone)]
pub struct TableLit(pub BoundedSeparated<TableLitElem>);

View file

@ -1,6 +1,6 @@
use crate::span::{HasSpan, Span};
use super::{Expr, Separated, Space, TableLitElem};
use super::{BoundedSeparated, Expr, Space, TableLitElem};
#[derive(Debug, Clone)]
pub enum TableConstrElem {
@ -31,18 +31,11 @@ impl HasSpan for TableConstrElem {
}
/// `{ a, b, foo: c, [d]: e }`
///
/// Structure: `{ s0 elems s1 }`
#[derive(Debug, Clone)]
pub struct TableConstr {
pub s0: Space,
pub elems: Separated<TableConstrElem, (Space, Space), Space>,
pub s1: Space,
pub span: Span,
}
pub struct TableConstr(pub BoundedSeparated<TableConstrElem>);
impl HasSpan for TableConstr {
fn span(&self) -> Span {
self.span
self.0.span()
}
}