Implement functions, arrays, maps, and while loops. Document and clean up code.

This commit is contained in:
2021-03-04 19:30:08 -08:00
parent 201030ed93
commit 53e0717b91
8 changed files with 475 additions and 111 deletions

View File

@@ -80,4 +80,4 @@ func doShellScript(args map[string]interface{}) (interface{}, error) {
} else {
return nil, errors.New("script not provided")
}
}
}

View File

@@ -26,7 +26,7 @@ func main() {
log.Fatalln("Error parsing file:", err)
}
scpt.AddFuncs(scpt.FuncMap{
"print": scptPrint,
"print": scptPrint,
"display-dialog": displayDialog,
"do-shell-script": doShellScript,
})
@@ -43,4 +43,4 @@ func scptPrint(args map[string]interface{}) (interface{}, error) {
}
fmt.Println(val)
return nil, nil
}
}