allow hollywoo readermacros to handle optional arguments

This commit is contained in:
2021-11-27 21:13:25 -07:00
parent 599ec4a94d
commit 7f06abe9e1
2 changed files with 17 additions and 8 deletions

View File

@@ -344,6 +344,8 @@ class Helpers {
FieldExp(field, removeTypeAnnotations(innerExp));
case KeyValueExp(keyExp, valueExp):
KeyValueExp(removeTypeAnnotations(keyExp), removeTypeAnnotations(valueExp));
case None:
None;
default:
throw CompileError.fromExp(exp, 'cannot remove type annotations');
};
@@ -404,6 +406,7 @@ class Helpers {
});
interp.variables.set("k", k.forMacroEval());
interp.variables.set("Macros", Macros);
interp.variables.set("Stream", Stream);
for (name => value in k.macroVars) {
interp.variables.set(name, value);
}