mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
parser: add ; after a goto label
This commit is contained in:
parent
090e1a87b7
commit
c30f16a038
@ -9,6 +9,10 @@ import (
|
|||||||
time
|
time
|
||||||
)
|
)
|
||||||
|
|
||||||
|
fn todo() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
fn (v mut V) cc() {
|
fn (v mut V) cc() {
|
||||||
v.build_thirdparty_obj_files()
|
v.build_thirdparty_obj_files()
|
||||||
vexe := vexe_path()
|
vexe := vexe_path()
|
||||||
@ -222,7 +226,8 @@ fn (v mut V) cc() {
|
|||||||
|
|
||||||
args := a.join(' ')
|
args := a.join(' ')
|
||||||
start:
|
start:
|
||||||
777 // TODO remove
|
todo()
|
||||||
|
// TODO remove
|
||||||
cmd := '${v.pref.ccompiler} $args'
|
cmd := '${v.pref.ccompiler} $args'
|
||||||
// Run
|
// Run
|
||||||
if v.pref.show_c_cmd || v.pref.is_verbose {
|
if v.pref.show_c_cmd || v.pref.is_verbose {
|
||||||
@ -232,22 +237,21 @@ start:
|
|||||||
ticks := time.ticks()
|
ticks := time.ticks()
|
||||||
res := os.exec(cmd) or { verror(err) return }
|
res := os.exec(cmd) or { verror(err) return }
|
||||||
if res.exit_code != 0 {
|
if res.exit_code != 0 {
|
||||||
|
|
||||||
if res.exit_code == 127 {
|
|
||||||
// the command could not be found by the system
|
// the command could not be found by the system
|
||||||
|
if res.exit_code == 127 {
|
||||||
|
$if linux {
|
||||||
|
// TCC problems on linux? Try GCC.
|
||||||
|
if v.pref.ccompiler == 'tcc' {
|
||||||
|
v.pref.ccompiler = 'cc'
|
||||||
|
goto start
|
||||||
|
}
|
||||||
|
}
|
||||||
verror('C compiler error, while attempting to run: \n' +
|
verror('C compiler error, while attempting to run: \n' +
|
||||||
'-----------------------------------------------------------\n' +
|
'-----------------------------------------------------------\n' +
|
||||||
'$cmd\n' +
|
'$cmd\n' +
|
||||||
'-----------------------------------------------------------\n' +
|
'-----------------------------------------------------------\n' +
|
||||||
'Probably your C compiler is missing. \n' +
|
'Probably your C compiler is missing. \n' +
|
||||||
'Please reinstall it, or make it available in your PATH.')
|
'Please reinstall it, or make it available in your PATH.')
|
||||||
// TCC problems on linux? Try gcc
|
|
||||||
$if linux {
|
|
||||||
if v.pref.ccompiler == 'tcc' {
|
|
||||||
v.pref.ccompiler = 'cc'
|
|
||||||
goto start
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if v.pref.is_debug {
|
if v.pref.is_debug {
|
||||||
|
@ -1065,7 +1065,7 @@ fn (p mut Parser) statement(add_semi bool) string {
|
|||||||
p.fmt_dec()
|
p.fmt_dec()
|
||||||
label := p.check_name()
|
label := p.check_name()
|
||||||
p.fmt_inc()
|
p.fmt_inc()
|
||||||
p.genln(label + ':')
|
p.genln(label + ': ;')
|
||||||
p.check(.colon)
|
p.check(.colon)
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user