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

@ -1,4 +1,4 @@
use crate::ast::{BoundedSeparated, Call, Expr, Ident, Lit, Space, TableLit, TableLitElem};
use crate::ast::{BoundedSeparated, Call, Expr, Ident, Lit, Space, TableLitElem};
// TODO Add span for just the parentheses to ast, or limit span to parentheses
@ -27,9 +27,9 @@ impl Call {
value: arg,
span,
};
let new = Expr::Lit(Lit::Table(TableLit(
BoundedSeparated::new(span).then(call).then(arg),
)));
let new = Expr::Lit(Lit::Table(
BoundedSeparated::new(span).then(call).then(arg).table_lit(),
));
(new, true)
}