xgbgen: process <doc> elements
Most of XCB documentation now ends up in Go sources, although the end result is of mixed quality.
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"fmt"
|
||||
"log"
|
||||
"sort"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Context represents the protocol we're converting to Go, and a writer
|
||||
@@ -34,6 +35,13 @@ func (c *Context) Put(format string, v ...interface{}) {
|
||||
}
|
||||
}
|
||||
|
||||
// PutComment writes each line of comment commented out to 'out'.
|
||||
func (c *Context) PutComment(comment string) {
|
||||
for _, line := range strings.Split(comment, "\n") {
|
||||
c.Putln("// %s", line)
|
||||
}
|
||||
}
|
||||
|
||||
// Morph is the big daddy of them all. It takes in an XML byte slice,
|
||||
// parse it, transforms the XML types into more usable types,
|
||||
// and writes Go code to the 'out' buffer.
|
||||
|
||||
Reference in New Issue
Block a user