func Interpret(n *Node, common *Node) (string, bool) { dsl.Spawn("bash") fmt.Printf("\n[34m== %s ==[0m\n\n", GetName(n)) s := scope{defs: make(map[string]*Node), blocks: make([]*Node, 0), test: false} interpret(common, &s) _, i := interpret(n, &s) dsl.Quit() //time.Sleep(1000*time.Millisecond) if i.typ == "lesson" { return i.value, false } else if i.typ == "done" { return i.value, true } else { return "", false } }
func InterpretTest(n *Node, common *Node) { dsl.Spawn("bash") s := scope{defs: make(map[string]*Node), blocks: make([]*Node, 0), test: true} interpret(common, &s) interpret(n, &s) }