コード例 #1
0
ファイル: circuit_test.go プロジェクト: jedahan/escher
func TestUnderstand(t *testing.T) {
	//fmt.Printf(src)
	for _, r := range src {
		s := see.SeeCircuit(see.NewSrcString(r))
		t := Understand(s)
		printf2(t.Print("", "\t"))
	}
}
コード例 #2
0
ファイル: see.go プロジェクト: dasmithii/escher
func (See) Materialize() be.Reflex {
	reflex, _ := plumb.NewEyeCognizer(
		func(eye *plumb.Eye, dvalve string, dvalue interface{}) {
			if dvalve != "Source" {
				return
			}
			eye.Show("Seen", es.SeeCircuit(es.NewSrcString(plumb.AsString(dvalue))))
		},
		"Source", "Seen",
	)
	return reflex
}
コード例 #3
0
func (fty Faculty) UnderstandFile(file string) {
	text, err := ioutil.ReadFile(file)
	if err != nil {
		println(file)
		panic(err)
	}
	src := see.NewSrcString(string(text))
	for {
		s := see.SeeCircuit(src)
		if s == nil {
			break
		}
		fty.interpretCircuit(Understand(s))
	}
}