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
// C flag
// parsed cflag
struct CFlag{
os string // eg. windows | darwin | linux
name string // eg. -I
value string // eg. /path/to/incude
}
// 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
value string // eg. /path/to/include
}
// get flags for current os
@ -47,7 +37,17 @@ fn (cf &CFlag) format() string {
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)
fn (table mut Table) parse_cflag(cflag string) {
allowed_flags := [