From 6de1f14a564f2146e700f42a53cf350fc954db30 Mon Sep 17 00:00:00 2001 From: Joe Conigliaro Date: Fri, 6 Sep 2019 22:43:03 +1000 Subject: [PATCH] fix comments & rearrange method --- compiler/cflags.v | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/compiler/cflags.v b/compiler/cflags.v index fd242ee1f5..2b50876f44 100644 --- a/compiler/cflags.v +++ b/compiler/cflags.v @@ -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 := [