Repository navigation
GWEB v0.10.5
GWEB v0.10.5 — a literate-programming system for Go, in the CWEB tradition.
This release completes the index's definition detection: gweave now underlines, without any @!, the names cweave underlines in C — structure fields, function parameters, and labels — along with Go's method names, named results, and type parameters.
Index: definitions found without @!
- Struct fields are indexed as definitions, as
cweaveunderlines a C structure's members. Embedded fields (sync.Mutex,*Node) name a type, not a field, and are left as uses. - Method names — the name after a method's receiver list — are definitions.
- Function parameters, named results, and type parameters are definitions, in a function declaration, a function literal, or a
functype: every name infunc Map[T any](xs []T, fn func(T) T) (n int)is underlined. As in Go, a list names its entries only if some entry has a name and a type, so the types infunc(Request, io.Reader) (Reply, error)are not taken for names. - Labels (
done:heading a statement) are definitions; acaseclause and a keyed composite element (Name: value) are not. - A method's receiver is deliberately left a use: it names the same value in every method of a type, and underlining it in each would say nothing.
Until now each of these needed an @! to be filed as a definition. Weaving 72 existing webs before and after changes nothing but index lines, adding over 1,500 underlined definitions and removing none.
Upgrading
- Nothing to change in your webs.
@!still works and is still needed for a definition the rules above cannot see, such as a parameter of an interface method. Reweave to see the fuller index.
Bootstrap is byte-for-byte reproducible (make bootstrap) and the full test suite passes.