erlang: -module/M:F cross-module calls (+10 tests)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled

This commit is contained in:
2026-04-25 04:01:14 +00:00
parent 882205aa70
commit 424b5ca472
6 changed files with 152 additions and 7 deletions

View File

@@ -479,7 +479,12 @@
((fun-node (get node :fun)) (args (get node :args)))
(cond
(= (get fun-node :type) "atom")
(er-apply-bif (get fun-node :value) (er-eval-args args env))
(let
((name (get fun-node :value)) (vs (er-eval-args args env)))
(cond
(and (dict-has? env name) (er-fun? (get env name)))
(er-apply-fun (get env name) vs)
:else (er-apply-bif name vs)))
(= (get fun-node :type) "remote")
(er-apply-remote-bif
(get (get fun-node :mod) :value)
@@ -584,6 +589,8 @@
(fn
(mod name vs)
(cond
(dict-has? (er-modules-get) mod)
(er-apply-user-module mod name vs)
(= mod "lists") (er-apply-lists-bif name vs)
(= mod "io") (er-apply-io-bif name vs)
(= mod "erlang") (er-apply-bif name vs)