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(); var b = arg.expBuilder();
switch (arg.def) { switch (arg.def) {
case MetaExp("prop", propExp): 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); argList.push(propExp);
propertyDefs.push( propertyDefs.push(
b.call(b.symbol("prop"), [propExp])); b.call(b.symbol("prop"), [propDeclExp]));
// TODO allow &prop &mut or &mut &prop
switch (propExp.def) { switch (propExp.def) {
case TypedExp(_, {pos: _, def: Symbol(name)}): case TypedExp(_, {pos: _, def: Symbol(name)}):
propertySetExps.push( propertySetExps.push(