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:
parent
bfdab586e3
commit
6de1f14a56
@ -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 := [
|
||||||
|
Loading…
Reference in New Issue
Block a user