Browse Source

Add `@main` to Runic module

This now supports the `-m` and the `juliac` workflow.
pull/160/head
Romeo Valentin 4 months ago
parent
commit
a508427212
  1. 2
      juliac/runicc.jl
  2. 4
      src/Runic.jl

2
juliac/runicc.jl

@ -1,7 +1,7 @@
using Runic: Runic using Runic: Runic
# Compileable main function corresponding to `int main(int argc, char** argv)` # 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 if length(args) == 1
Runic.print_help() Runic.print_help()
return 0 return 0

4
src/Runic.jl

@ -2,6 +2,10 @@
module Runic module Runic
function (@main)(argv)
return main(argv)
end
if VERSION >= v"1.11.0-DEV.469" if VERSION >= v"1.11.0-DEV.469"
let str = "public format_file, format_string" let str = "public format_file, format_string"
eval(Meta.parse(str)) eval(Meta.parse(str))

Loading…
Cancel
Save