Simplify creating TableLit and TableConstr

This commit is contained in:
Joscha 2022-11-22 15:21:29 +01:00
parent c769d9e16f
commit 5a977e6dde
9 changed files with 83 additions and 68 deletions

View file

@ -2,6 +2,8 @@ use std::fmt;
use crate::span::{HasSpan, Span};
use super::{TableConstr, TableConstrElem, TableLit, TableLitElem};
#[derive(Clone)]
pub enum Line {
Empty,
@ -105,3 +107,15 @@ impl<E> BoundedSeparated<E> {
self
}
}
impl BoundedSeparated<TableLitElem> {
pub fn table_lit(self) -> TableLit {
TableLit(self)
}
}
impl BoundedSeparated<TableConstrElem> {
pub fn table_constr(self) -> TableConstr {
TableConstr(self)
}
}