Skip to content

Commit 207ebf3

Browse files
authored
Merge pull request #100 from sogaiu/err-msg-for-no-main
2 parents e46bce6 + b5ac268 commit 207ebf3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

jpm/cc.janet

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,9 @@ int main(int argc, const char **argv) {
300300
# Load entry environment and get main function.
301301
(def env (make-env))
302302
(def entry-env (dofile source :env env))
303-
(def main ((entry-env 'main) :value))
303+
(def main (get-in entry-env ['main :value]))
304+
(assert (and main (function? main))
305+
(string/format "no main function in %s" source))
304306
(def dep-lflags @[])
305307
(def dep-ldflags @[])
306308

0 commit comments

Comments
 (0)