Simplify creating Call

This commit is contained in:
Joscha 2022-11-22 16:55:27 +01:00
parent 78d08968eb
commit 009be99aaa
6 changed files with 63 additions and 80 deletions

View file

@ -16,12 +16,11 @@ impl Field {
.then(TableConstrElem::positional(expr))
.then(TableConstrElem::positional(index))
.table_constr();
let new = Call::Constr {
expr: Lit::Builtin(Builtin::Get, span).expr().boxed(),
s0: Space::empty(span),
let new = Call::constr(
Lit::Builtin(Builtin::Get, span).expr().boxed(),
constr,
span,
};
);
(new.expr(), true)
}
@ -41,12 +40,11 @@ impl Field {
.then(TableConstrElem::positional(index))
.then(TableConstrElem::positional(value))
.table_constr();
let new = Call::Constr {
expr: Lit::Builtin(Builtin::Set, span).expr().boxed(),
s0: Space::empty(span),
let new = Call::constr(
Lit::Builtin(Builtin::Set, span).expr().boxed(),
constr,
span,
};
);
(new.expr(), true)
}