add rudimentary control flow

This commit is contained in:
Aidan 2020-06-30 20:27:12 -07:00
parent de5566b3ec
commit a216d9af41
No known key found for this signature in database
GPG key ID: 327711E983899316
3 changed files with 115 additions and 1 deletions

View file

@ -91,6 +91,10 @@ func GetVarFromTables(arg string, library []VarTable) *Token {
}
func InitVarTable(table VarTable) {
if !SyncTablesWithOSEnviron {
return
}
for _, val := range os.Environ() {
variable := strings.Split(val, "=")
t := &Token{inner: variable[1]}
@ -100,6 +104,9 @@ func InitVarTable(table VarTable) {
t.Tag = STRING
}
if variable[0] == "HOME" {
SetVar('~', t, table)
}
SetVar(variable[0], t, table)
}
}