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

fix comments & rearrange method

This commit is contained in:
Joe Conigliaro 2019-09-06 22:43:03 +10:00 committed by Alexander Medvednikov
parent bfdab586e3
commit 6de1f14a56

View File

@ -6,21 +6,11 @@ module main
import os import os
// C flag // parsed cflag
struct CFlag{ struct CFlag{
os string // eg. windows | darwin | linux os string // eg. windows | darwin | linux
name string // eg. -I name string // eg. -I
value string // eg. /path/to/incude value string // eg. /path/to/include
}
// check if cflag is in table
fn (table &Table) has_cflag(cflag CFlag) bool {
for cf in table.cflags {
if cf.os == cflag.os && cf.name == cflag.name && cf.value == cflag.value {
return true
}
}
return false
} }
// get flags for current os // get flags for current os
@ -47,7 +37,17 @@ fn (cf &CFlag) format() string {
return '$cf.name $value'.trim_space() return '$cf.name $value'.trim_space()
} }
// parse the flags to []CFlag // check if cflag is in table
fn (table &Table) has_cflag(cflag CFlag) bool {
for cf in table.cflags {
if cf.os == cflag.os && cf.name == cflag.name && cf.value == cflag.value {
return true
}
}
return false
}
// parse the flags to (table.cflags) []CFlag
// Note: clean up big time (joe-c) // Note: clean up big time (joe-c)
fn (table mut Table) parse_cflag(cflag string) { fn (table mut Table) parse_cflag(cflag string) {
allowed_flags := [ allowed_flags := [