Replace DebugString with Describe
This change makes tree description completely open to mechanical analysis and ensures consistency between description formats for each of the iterator types. Renamed StatsContainer.(Kind -> Type) for consistency.
This commit is contained in:
parent
b5f113203d
commit
62013d3dfc
22 changed files with 186 additions and 162 deletions
|
|
@ -17,6 +17,7 @@ package sexp
|
|||
// Defines a running session of the sexp query language.
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"sort"
|
||||
|
|
@ -74,7 +75,12 @@ func (s *Session) ExecInput(input string, out chan interface{}, limit int) {
|
|||
}
|
||||
|
||||
if s.debug {
|
||||
fmt.Println(it.DebugString(0))
|
||||
b, err := json.MarshalIndent(it.Describe(), "", " ")
|
||||
if err != nil {
|
||||
fmt.Printf("failed to format description: %v", err)
|
||||
} else {
|
||||
fmt.Printf("%s", b)
|
||||
}
|
||||
}
|
||||
nResults := 0
|
||||
for graph.Next(it) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue