Convert OS to enum

pull/417/head
Ivan Greene 2019-06-22 23:34:41 -05:00 committed by Alex Medvednikov
parent 1152180a71
commit 6c6be7acaa
2 changed files with 7 additions and 9 deletions

View File

@ -33,13 +33,11 @@ const (
TmpPath = vtmp_path() TmpPath = vtmp_path()
) )
// TODO V was re-written in V before enums were implemented. Lots of consts need to be replaced with enum Os {
// enums. MAC
const ( LINUX
MAC = 0 WINDOWS
LINUX = 1 }
WINDOWS = 2
)
enum Pass { enum Pass {
// A very short pass that only looks at imports in the begginning of each file // A very short pass that only looks at imports in the begginning of each file
@ -63,7 +61,7 @@ enum Pass {
struct V { struct V {
mut: mut:
build_mode BuildMode build_mode BuildMode
os int // the OS to build for os Os // the OS to build for
nofmt bool // disable vfmt nofmt bool // disable vfmt
out_name_c string // name of the temporary C file out_name_c string // name of the temporary C file
files []string // all V files that need to be parsed and compiled files []string // all V files that need to be parsed and compiled

View File

@ -41,7 +41,7 @@ mut:
cgen *CGen cgen *CGen
table *Table table *Table
run Pass // TODO rename `run` to `pass` run Pass // TODO rename `run` to `pass`
os int os Os
pkg string pkg string
inside_const bool inside_const bool
expr_var Var expr_var Var