fix error when (defmethod) is used in function body

This commit is contained in:
2021-06-26 13:03:31 -06:00
parent 27ee9b8851
commit b445717b44

View File

@@ -23,7 +23,15 @@ class SpecialForms {
map["begin"] = (wholeExp:ReaderExp, args:Array<ReaderExp>, k:KissState) -> { map["begin"] = (wholeExp:ReaderExp, args:Array<ReaderExp>, k:KissState) -> {
// Sometimes empty blocks are useful, so a checkNumArgs() seems unnecessary here for now. // Sometimes empty blocks are useful, so a checkNumArgs() seems unnecessary here for now.
EBlock([for (bodyExp in args) k.convert(bodyExp)]).withMacroPosOf(wholeExp); // blocks can contain field forms that don't return an expression. These can't be included in blocks
var exprs = [];
for (bodyExp in args) {
var expr = k.convert(bodyExp);
if (expr != null) {
exprs.push(expr);
}
}
EBlock(exprs).withMacroPosOf(wholeExp);
}; };
function arrayAccess(wholeExp:ReaderExp, args:Array<ReaderExp>, k:KissState) { function arrayAccess(wholeExp:ReaderExp, args:Array<ReaderExp>, k:KissState) {