Had missed handling the empty call case () as an error in compile, which will happen when specutively compiling as code a nil that should be passed unevaluated, etc

This commit is contained in:
Nathan Braswell
2022-02-12 12:10:08 -05:00
parent d5ea55fa08
commit fd37fa9b00

View File

@@ -3235,6 +3235,7 @@
) (array result nil nil (array datasi funcs memo env pectx)))))))) ) (array result nil nil (array datasi funcs memo env pectx))))))))
(if need_value (array nil nil (str "errr, needed value and was call " (str_strip c)) ctx) (if need_value (array nil nil (str "errr, needed value and was call " (str_strip c)) ctx)
(if (= 0 (len (.marked_array_values c))) (array nil nil (str "errr, empty call array" (str_strip c)) ctx)
(dlet ( (dlet (
; This can weirdly cause infinate recursion on the compile side, if partial_eval ; This can weirdly cause infinate recursion on the compile side, if partial_eval
@@ -3369,7 +3370,7 @@
(i32.wrap_i64 (i64.shr_u (local.get '$tmp) (i64.const 35))) (i32.wrap_i64 (i64.shr_u (local.get '$tmp) (i64.const 35)))
))) )))
) (array nil result_code func_err ctx))) ) (array nil result_code func_err ctx)))
))))) ))))))
((marked_env? c) (or (get_passthrough (.hash c) ctx) (dlet ((e (.env_marked c)) ((marked_env? c) (or (get_passthrough (.hash c) ctx) (dlet ((e (.env_marked c))
@@ -4170,8 +4171,8 @@
(write_file "./csc_out.wasm" (compile (partial_eval (read-string (slurp "to_compile.kp"))))) (write_file "./csc_out.wasm" (compile (partial_eval (read-string (slurp "to_compile.kp")))))
)) ))
) (test-most)) ;) (test-most))
;) (run-compiler)) ) (run-compiler))
;) (single-test)) ;) (single-test))
) )