Delete the doc lines the panel read as restating their code
This commit is contained in:
@@ -11,8 +11,8 @@ import (
|
|||||||
"github.com/larvit/fejkdata/internal/invariant"
|
"github.com/larvit/fejkdata/internal/invariant"
|
||||||
)
|
)
|
||||||
|
|
||||||
// checkCalcFields runs checkOperands over the calc operands fields hold. An operand no field
|
// checkCalcFields leaves an operand no field holds for a name, which checkCalcNames checks once
|
||||||
// holds is left for a name, which checkCalcNames checks once names resolve.
|
// names resolve.
|
||||||
func checkCalcFields(args []string, fields map[string]node) error {
|
func checkCalcFields(args []string, fields map[string]node) error {
|
||||||
return checkOperands(args[0], builtinfunc.ParsedCalc(args[0]), func(name string) []node {
|
return checkOperands(args[0], builtinfunc.ParsedCalc(args[0]), func(name string) []node {
|
||||||
if n, ok := fields[name]; ok {
|
if n, ok := fields[name]; ok {
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ func loadData(sources []datafiles.Source) (map[string]node, error) {
|
|||||||
return root, nil
|
return root, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// compileInto compiles each category it is handed into the folder place returns for its Folders.
|
|
||||||
func compileInto(place func(dir []string) *folder) func(datafiles.Category) error {
|
func compileInto(place func(dir []string) *folder) func(datafiles.Category) error {
|
||||||
return func(c datafiles.Category) error {
|
return func(c datafiles.Category) error {
|
||||||
n, err := compileCategory(c)
|
n, err := compileCategory(c)
|
||||||
@@ -51,9 +50,6 @@ func madeFolder(root *folder, dir []string) *folder {
|
|||||||
return g
|
return g
|
||||||
}
|
}
|
||||||
|
|
||||||
// mergeChildren overlays src onto dst. Two folders under the same key merge
|
|
||||||
// recursively (so locales/categories from several paths combine); every other
|
|
||||||
// key is replaced, making the last-loaded directory win on a conflict.
|
|
||||||
func mergeChildren(dst, src map[string]node) {
|
func mergeChildren(dst, src map[string]node) {
|
||||||
for k, v := range src {
|
for k, v := range src {
|
||||||
if dg, ok := dst[k].(*folder); ok {
|
if dg, ok := dst[k].(*folder); ok {
|
||||||
|
|||||||
@@ -220,7 +220,6 @@ func join(prefix, name string) string {
|
|||||||
return prefix + "." + name
|
return prefix + "." + name
|
||||||
}
|
}
|
||||||
|
|
||||||
// randomBytes seeds an unseeded generator.
|
|
||||||
var randomBytes = crand.Read
|
var randomBytes = crand.Read
|
||||||
|
|
||||||
// drawSeed is the seed WithSeed gave, or one read from the system's entropy.
|
// drawSeed is the seed WithSeed gave, or one read from the system's entropy.
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ type Template struct {
|
|||||||
n node
|
n node
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fake renders the template once.
|
|
||||||
func (t *Template) Fake() string {
|
func (t *Template) Fake() string {
|
||||||
t.g.mu.Lock()
|
t.g.mu.Lock()
|
||||||
defer t.g.mu.Unlock()
|
defer t.g.mu.Unlock()
|
||||||
|
|||||||
@@ -76,7 +76,6 @@ type frameStack struct {
|
|||||||
frames []*pickFrame
|
frames []*pickFrame
|
||||||
}
|
}
|
||||||
|
|
||||||
// push opens f until pop closes it, returning the mark pop takes.
|
|
||||||
func (st *frameStack) push(f *pickFrame) int {
|
func (st *frameStack) push(f *pickFrame) int {
|
||||||
mark := len(st.frames)
|
mark := len(st.frames)
|
||||||
st.frames = append(st.frames, f)
|
st.frames = append(st.frames, f)
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ type Record struct {
|
|||||||
columns []Column
|
columns []Column
|
||||||
}
|
}
|
||||||
|
|
||||||
// Columns returns the record's columns in name order.
|
|
||||||
func (r *Record) Columns() []Column {
|
func (r *Record) Columns() []Column {
|
||||||
return append([]Column(nil), r.columns...)
|
return append([]Column(nil), r.columns...)
|
||||||
}
|
}
|
||||||
@@ -214,8 +213,7 @@ func (f *Generator) FakeRecordTemplate(input string) (*Record, error) {
|
|||||||
// the record to write instead.
|
// the record to write instead.
|
||||||
var ErrNoColumns = errors.New("has no fields, so no columns")
|
var ErrNoColumns = errors.New("has no fields, so no columns")
|
||||||
|
|
||||||
// recordOf is the record template n is, the fence FakeRecord, NewRecordTemplate and FakeStruct
|
// recordOf is the record template n is; settleRecords fixed its columns at load.
|
||||||
// pass; settleRecords fixed its columns at load.
|
|
||||||
func recordOf(n node) (*template, error) {
|
func recordOf(n node) (*template, error) {
|
||||||
if tb, isTable := n.(*table); isTable {
|
if tb, isTable := n.(*table); isTable {
|
||||||
n = tb.formatTemplate
|
n = tb.formatTemplate
|
||||||
|
|||||||
@@ -109,8 +109,6 @@ func renderRepeat(s *drawstate.State, t *template, env renderEnv) string {
|
|||||||
return b.String()
|
return b.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
// drawItem selects one item. Uniform choices are O(1); weighted choices are an
|
|
||||||
// O(log n) search over precomputed cumulative weights.
|
|
||||||
func drawItem(s *drawstate.State, c *choice) node {
|
func drawItem(s *drawstate.State, c *choice) node {
|
||||||
if c.cum == nil {
|
if c.cum == nil {
|
||||||
return c.items[s.IntN(len(c.items))]
|
return c.items[s.IntN(len(c.items))]
|
||||||
|
|||||||
+4
-4
@@ -61,10 +61,10 @@ type resolvedNames struct {
|
|||||||
uses map[*nameBinding][]nameUse
|
uses map[*nameBinding][]nameUse
|
||||||
}
|
}
|
||||||
|
|
||||||
// resolveTemplates resolves ts in steps, each over every template before the next starts. Each step
|
// resolveTemplates resolves ts in steps, each over every template before the next starts. The
|
||||||
// returns what it builds. The references, the compiled format and the column read are kept on each
|
// references, the compiled format and the column read are kept on each template. The names'
|
||||||
// template. The names' targets, keys and reads pass to later steps as arguments, and the bindings
|
// targets, keys and reads pass to later steps as arguments, and the bindings take their targets
|
||||||
// take their targets and keys only once every check has passed.
|
// and keys only once every check has passed.
|
||||||
func resolveTemplates(ts []templateSite, root map[string]node) error {
|
func resolveTemplates(ts []templateSite, root map[string]node) error {
|
||||||
for _, s := range ts {
|
for _, s := range ts {
|
||||||
refs, err := s.t.resolveRefs(s.folder, s.label, s.category, root)
|
refs, err := s.t.resolveRefs(s.folder, s.label, s.category, root)
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ func (t *table) cellTemplate(row, col int) *template {
|
|||||||
|
|
||||||
func (t *table) cellIndex(row, col int) int { return row*len(t.rows.Header()) + col }
|
func (t *table) cellIndex(row, col int) int { return row*len(t.rows.Header()) + col }
|
||||||
|
|
||||||
// tableOptions are the keys a table object takes; every other key is refused.
|
|
||||||
var tableOptions = []string{"format", "key", "name", "parent", "rows", "weight"}
|
var tableOptions = []string{"format", "key", "name", "parent", "rows", "weight"}
|
||||||
|
|
||||||
func isTableOption(name string) bool {
|
func isTableOption(name string) bool {
|
||||||
|
|||||||
Reference in New Issue
Block a user