From a5084272126cdbc4a15742dac6eb7734eb16e151 Mon Sep 17 00:00:00 2001 From: Romeo Valentin Date: Thu, 31 Jul 2025 16:45:37 -0700 Subject: [PATCH] Add `@main` to Runic module This now supports the `-m` and the `juliac` workflow. --- juliac/runicc.jl | 2 +- src/Runic.jl | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/juliac/runicc.jl b/juliac/runicc.jl index 7bc44bc..59a2f8c 100644 --- a/juliac/runicc.jl +++ b/juliac/runicc.jl @@ -1,7 +1,7 @@ using Runic: Runic # Compileable main function corresponding to `int main(int argc, char** argv)` -function @main(args::Vector{String})::Cint +function (@main)(args::Vector{String})::Cint if length(args) == 1 Runic.print_help() return 0 diff --git a/src/Runic.jl b/src/Runic.jl index b8640be..9f49d5d 100644 --- a/src/Runic.jl +++ b/src/Runic.jl @@ -2,6 +2,10 @@ module Runic +function (@main)(argv) + return main(argv) +end + if VERSION >= v"1.11.0-DEV.469" let str = "public format_file, format_string" eval(Meta.parse(str))