Make great documentation goal 1.2, and plan the README's reorganisation and the nested-template gaps #33

Open
lilleman wants to merge 966 commits from worktree-todo-relative-dates-exact-counts into main
4 changed files with 11 additions and 4 deletions
Showing only changes of commit bb2bbe9697 - Show all commits
+4 -1
View File
@@ -329,9 +329,12 @@ func (t *table) compileWhole(format string) error {
return err return err
} }
for _, tok := range toks { for _, tok := range toks {
if tok.kind != 'f' {
continue
}
for _, name := range tok.names { for _, name := range tok.names {
a := splitArm(name, nil) a := splitArm(name, nil)
if _, ok := t.col[a.key]; tok.kind == 'f' && !ok && !isRef(a.key) && a.key != "" { if _, ok := t.col[a.key]; !ok && !isRef(a.key) && a.key != "" {
return fmt.Errorf("format names no column %q of %s; the columns are %v", a.key, t.file, t.columns) return fmt.Errorf("format names no column %q of %s; the columns are %v", a.key, t.file, t.columns)
} }
} }
+2 -2
View File
@@ -265,10 +265,10 @@ func hintableRef(name string) bool {
} }
// builtinOperands lists the fields a call reads as operands, empty for a builtin that // builtinOperands lists the fields a call reads as operands, empty for a builtin that
// reads none, or a call checkFunc refuses. // reads none or is unknown.
func builtinOperands(name string, args []string) []string { func builtinOperands(name string, args []string) []string {
b, known := builtins[name] b, known := builtins[name]
if !known || b.operands == nil || (b.arity >= 0 && len(args) != b.arity) { if !known || b.operands == nil {
return nil return nil
} }
return b.operands(args) return b.operands(args)
+2 -1
View File
@@ -37,7 +37,8 @@ This round, in order:
- Split `drawCheck.reads`'s six-term condition into named predicates. - Split `drawCheck.reads`'s six-term condition into named predicates.
- Rename what names two things: `template.go` holds the token grammar while `template` - Rename what names two things: `template.go` holds the token grammar while `template`
is `node.go`'s type and `Template` `inline.go`'s; `kind` `'b'` is a brace body in is `node.go`'s type and `Template` `inline.go`'s; `kind` `'b'` is a brace body in
`ftoken` and a builtin in `op`; `drawAt.alt` holds the rows `ftoken` and a builtin in `formatToken` and `op`; `tokens` is a template's parsed format
and a table's cell templates; `drawAt.alt` holds the rows
a walk entered. a walk entered.
- Run the nine-seat panel again and file what it names here. - Run the nine-seat panel again and file what it names here.
+3
View File
@@ -45,6 +45,9 @@ func transformArg(fields map[string]node, a []string) error {
return checkArm(leaf, fields, false) return checkArm(leaf, fields, false)
} }
func transformOperand(a []string) []string { func transformOperand(a []string) []string {
if len(a) != 1 {
return nil
}
leaf, _, err := unwrapTransform(a[0]) leaf, _, err := unwrapTransform(a[0])
if err != nil { if err != nil {
return nil return nil