1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

main: generate main body on new line

Fix issue #1551
This commit is contained in:
Rendims 2019-08-10 00:56:44 +02:00 committed by Alexander Medvednikov
parent d4441e4353
commit 45766dcb2e

View File

@ -465,7 +465,9 @@ string _STR_TMP(const char *fmt, ...) {
// It can be skipped in single file programs // It can be skipped in single file programs
if v.pref.is_script { if v.pref.is_script {
//println('Generating main()...') //println('Generating main()...')
cgen.genln('int main() { init_consts(); $cgen.fn_main; return 0; }') cgen.genln('int main() { init_consts();')
cgen.genln('$cgen.fn_main;')
cgen.genln('return 0; }')
} }
else { else {
println('panic: function `main` is undeclared in the main module') println('panic: function `main` is undeclared in the main module')