diff --git a/src/vm/wren_compiler.c b/src/vm/wren_compiler.c index c11dac8b..af03e30d 100644 --- a/src/vm/wren_compiler.c +++ b/src/vm/wren_compiler.c @@ -2659,7 +2659,8 @@ static GrammarRule* getRule(TokenType type) return &rules[type]; } -// TODO: Doc. +// Completes parsing an expression after the prefix part has been parsed. +// Parses any trailing infix expressions. static void parseInfix(Compiler* compiler, bool allowAssignment, Precedence precedence) { diff --git a/src/vm/wren_core.c b/src/vm/wren_core.c index 79ef463a..d20bb68e 100644 --- a/src/vm/wren_core.c +++ b/src/vm/wren_core.c @@ -235,14 +235,6 @@ DEF_PRIMITIVE(fiber_yield1) return false; } -DEF_PRIMITIVE(fn_new) -{ - if (!validateFn(vm, args[1], "Argument")) return false; - - // The block argument is already a function, so just return it. - RETURN_VAL(args[1]); -} - DEF_PRIMITIVE(fn_arity) { RETURN_NUM(AS_FN(args[0])->arity); @@ -1161,7 +1153,6 @@ void wrenInitializeCore(WrenVM* vm) PRIMITIVE(vm->fiberClass, "try()", fiber_try); vm->fnClass = AS_CLASS(wrenFindVariable(vm, coreModule, "Fn")); - PRIMITIVE(vm->fnClass->obj.classObj, "new(_)", fn_new); PRIMITIVE(vm->fnClass, "arity", fn_arity); fnCall(vm, "call()"); diff --git a/test/core/function/new_wrong_arg_type.wren b/test/core/function/new_wrong_arg_type.wren deleted file mode 100644 index 0c27fb15..00000000 --- a/test/core/function/new_wrong_arg_type.wren +++ /dev/null @@ -1 +0,0 @@ -Fn.new(3) // expect runtime error: Argument must be a function.