arrow lambdas allow single call expression

This commit is contained in:
2021-06-27 18:58:21 -06:00
parent 4bf227bb13
commit c81c893a2a

View File

@@ -103,11 +103,11 @@ class Reader {
case Symbol(_):
argsExp = b.list([firstExp]);
bodyExp = assertRead(stream, k);
case CallExp({pos: _, def: Symbol("begin")}, _):
case CallExp(_, _):
argsExp = b.list([]);
bodyExp = firstExp;
default:
throw CompileError.fromExp(firstExp, "first expression after -> should be [args...], arg, or {body}, or one of those prefixed with :Void");
throw CompileError.fromExp(firstExp, "first expression after -> should be [args...], arg, (exp) or {body}, or one of those prefixed with :Void");
}
if (!returnsValue) {
argsExp = TypedExp("Void", argsExp).withPosOf(argsExp);