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

checker: do not allow extra () in if conditions

This commit is contained in:
Alexander Medvednikov
2020-03-27 14:57:19 +01:00
parent 1a751208ca
commit 473d9fef55
11 changed files with 33 additions and 23 deletions

View File

@@ -29,7 +29,7 @@ fn (p mut Parser) comp_if() ast.CompIf {
if ((!is_not && os != p.pref.os) || (is_not && os == p.pref.os)) && !p.pref.output_cross_c {
skip_os = true
p.check(.lcbr)
p.warn('SKIPPING $val os=$os p.pref.os=$p.pref.os')
//p.warn('skipping $if $val os=$os p.pref.os=$p.pref.os')
mut stack := 1
for {
if p.tok.kind == .key_return {
@@ -74,6 +74,10 @@ fn (p mut Parser) comp_if() ast.CompIf {
return node
}
const (
todo_delete_me = pref.OS.linux // TODO import warning bug
)
fn os_from_string(os string) pref.OS {
match os {
'linux' {