From 7037965973f864c4847ab819c0743675b4ec70d8 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Tue, 19 Jan 2021 08:33:03 +0200 Subject: [PATCH] parser: cleanup unused `p.os_from_string` --- vlib/v/parser/comptime.v | 58 ---------------------------------------- vlib/v/util/util.v | 4 ++- 2 files changed, 3 insertions(+), 59 deletions(-) diff --git a/vlib/v/parser/comptime.v b/vlib/v/parser/comptime.v index 8d786cb4ee..2e74b296f8 100644 --- a/vlib/v/parser/comptime.v +++ b/vlib/v/parser/comptime.v @@ -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 diff --git a/vlib/v/util/util.v b/vlib/v/util/util.v index 06feeccec8..53ed4332b4 100644 --- a/vlib/v/util/util.v +++ b/vlib/v/util/util.v @@ -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')