Better error message for non-field forms at top level

This commit is contained in:
2021-04-02 11:18:46 -06:00
parent 931d489c70
commit a75dd13903

View File

@@ -180,7 +180,7 @@ class Kiss {
case CallExp({pos: _, def: Symbol(formName)}, args) if (fieldForms.exists(formName)):
fieldForms[formName](exp, args, k);
default:
if (errorIfNot) throw CompileError.fromExp(exp, 'invalid valid field form'); else return null;
if (errorIfNot) throw CompileError.fromExp(exp, 'top-level expressions must be (or expand into) field definitions'); else return null;
};
}