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

parser: cleanup unused p.os_from_string

This commit is contained in:
Delyan Angelov 2021-01-19 08:33:03 +02:00
parent b44c08aff0
commit 7037965973
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
2 changed files with 3 additions and 59 deletions

View File

@ -252,64 +252,6 @@ fn (mut p Parser) at() ast.AtExpr {
}
}
// TODO import warning bug
const (
todo_delete_me = pref.OS.linux
)
fn os_from_string(os string) pref.OS {
match os {
'linux' {
return .linux
}
'windows' {
return .windows
}
'ios' {
return .ios
}
'macos' {
return .macos
}
'freebsd' {
return .freebsd
}
'openbsd' {
return .openbsd
}
'netbsd' {
return .netbsd
}
'dragonfly' {
return .dragonfly
}
'js' {
return .js
}
'solaris' {
return .solaris
}
'android' {
return .android
}
'msvc' {
// notice that `-os msvc` became `-cc msvc`
verror('use the flag `-cc msvc` to build using msvc')
}
'haiku' {
return .haiku
}
'linux_or_macos' {
return .linux
}
else {
panic('bad os $os')
}
}
// println('bad os $os') // todo panic?
return .linux
}
fn (mut p Parser) comptime_selector(left ast.Expr) ast.Expr {
p.check(.dollar)
mut has_parens := false

View File

@ -472,7 +472,9 @@ pub fn prepare_tool_when_needed(source_name string) {
pub fn recompile_file(vexe string, file string) {
cmd := '$vexe $file'
println('recompilation command: $cmd')
$if trace_recompilation ? {
println('recompilation command: $cmd')
}
recompile_result := os.system(cmd)
if recompile_result != 0 {
eprintln('could not recompile $file')