Allow void return statements
This commit is contained in:
@@ -220,8 +220,9 @@ class SpecialForms {
|
||||
};
|
||||
|
||||
map["return"] = (wholeExp:ReaderExp, args:Array<ReaderExp>, k:KissState) -> {
|
||||
wholeExp.checkNumArgs(1, 1, '(return [value])');
|
||||
EReturn(k.convert(args[0])).withMacroPosOf(wholeExp);
|
||||
wholeExp.checkNumArgs(0, 1, '(return [?value])');
|
||||
var returnExpr = if (args.length == 1) k.convert(args[0]) else null;
|
||||
EReturn(returnExpr).withMacroPosOf(wholeExp);
|
||||
};
|
||||
|
||||
map["break"] = (wholeExp:ReaderExp, args:Array<ReaderExp>, k:KissState) -> {
|
||||
|
Reference in New Issue
Block a user