new eval.go
This commit is contained in:
parent
89d6a1013b
commit
2a2e5b4527
15 changed files with 382 additions and 1215 deletions
|
|
@ -46,8 +46,6 @@ func setLogLvl() {
|
|||
}
|
||||
|
||||
func main() {
|
||||
ast.CallExecutablesFromUndefFuncCalls = true
|
||||
|
||||
debug := os.Getenv("SH_DEBUG_MODE")
|
||||
hist := os.Getenv("SH_HIST_FILE")
|
||||
prompt := os.Getenv("SHS_SH_PROMPT")
|
||||
|
|
@ -57,8 +55,10 @@ func main() {
|
|||
|
||||
funcs = stdlib.GenFuncTable()
|
||||
vars = &map[string]*ast.Token{}
|
||||
|
||||
ast.InitVarTable(vars)
|
||||
ast.SyncTablesWithOSEnviron = true
|
||||
ast.ExecWhenFuncUndef = false
|
||||
|
||||
var err error
|
||||
|
||||
|
|
@ -96,12 +96,8 @@ func main() {
|
|||
ast.PrintSExprsIndividually(userInput)
|
||||
}
|
||||
|
||||
result, unwrap := userInput.Eval(funcs, vars)
|
||||
result := userInput.Eval(funcs, vars)
|
||||
if result != nil {
|
||||
if result.Tag == ast.LIST && unwrap {
|
||||
result = result.Inner.(*ast.Token)
|
||||
}
|
||||
|
||||
for i := result; i != nil; i = i.Next {
|
||||
fmt.Printf(i.String() + " ")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue