allow &prop &mut

This commit is contained in:
2021-10-29 17:32:00 -04:00
parent a45f91b5a4
commit 432473ff76

View File

@@ -729,10 +729,16 @@ class Macros {
var b = arg.expBuilder();
switch (arg.def) {
case MetaExp("prop", propExp):
// TODO allow the reverse order (&mut &prop)
var propDeclExp = propExp;
switch (propExp.def) {
case MetaExp("mut", innerExp):
propExp = innerExp;
default:
}
argList.push(propExp);
propertyDefs.push(
b.call(b.symbol("prop"), [propExp]));
// TODO allow &prop &mut or &mut &prop
b.call(b.symbol("prop"), [propDeclExp]));
switch (propExp.def) {
case TypedExp(_, {pos: _, def: Symbol(name)}):
propertySetExps.push(