Simplify creating TableLit and TableConstr
This commit is contained in:
parent
c769d9e16f
commit
5a977e6dde
9 changed files with 83 additions and 68 deletions
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue