cgen: fix `-printfn main`
parent
dff385cb37
commit
652380c5fd
|
@ -23,10 +23,6 @@ const (
|
|||
)
|
||||
|
||||
fn main() {
|
||||
main_v()
|
||||
}
|
||||
|
||||
fn main_v() {
|
||||
args := os.args[1..]
|
||||
// args = 123
|
||||
if args.len == 0 || args[0] in ['-', 'repl'] {
|
||||
|
|
|
@ -7,10 +7,14 @@ pub fn (mut g Gen) gen_c_main() {
|
|||
if g.pref.is_liveshared {
|
||||
return
|
||||
}
|
||||
g.out.writeln('')
|
||||
g.out.writeln('')
|
||||
main_fn_start_pos := g.out.len
|
||||
g.gen_c_main_header()
|
||||
g.writeln('\tmain__main();')
|
||||
g.gen_c_main_footer()
|
||||
g.gen_c_main_footer()
|
||||
if g.pref.printfn_list.len > 0 && 'main' in g.pref.printfn_list {
|
||||
println(g.out.after(main_fn_start_pos))
|
||||
}
|
||||
}
|
||||
|
||||
fn (mut g Gen) gen_c_main_header() {
|
||||
|
|
Loading…
Reference in New Issue