aboutsummaryrefslogtreecommitdiff
path: root/nexgb/xgbgen/go.go
diff options
context:
space:
mode:
authorPřemysl Janouch <p@janouch.name>2018-09-29 21:42:23 +0200
committerPřemysl Janouch <p@janouch.name>2018-09-30 17:34:26 +0200
commit3e9ed4eac6a953b2616bcf129b515a857271acdc (patch)
treeb7e674aa21fe3044eec6071e0d990c3933ba5f0d /nexgb/xgbgen/go.go
parent0056720d05d72d7b3a1b3cbdae5b5c5d80e167d3 (diff)
downloadhaven-3e9ed4eac6a953b2616bcf129b515a857271acdc.tar.gz
haven-3e9ed4eac6a953b2616bcf129b515a857271acdc.tar.xz
haven-3e9ed4eac6a953b2616bcf129b515a857271acdc.zip
xgbgen: process <doc> elements
Most of XCB documentation now ends up in Go sources, although the end result is of mixed quality.
Diffstat (limited to 'nexgb/xgbgen/go.go')
-rw-r--r--nexgb/xgbgen/go.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/nexgb/xgbgen/go.go b/nexgb/xgbgen/go.go
index 87b5028..8a4080d 100644
--- a/nexgb/xgbgen/go.go
+++ b/nexgb/xgbgen/go.go
@@ -168,7 +168,13 @@ func (f *ExprField) Write(c *Context, prefix string) {
// Value field
func (f *ValueField) Define(c *Context) {
+ if f.MaskComment != "" {
+ c.PutComment(f.MaskComment)
+ }
c.Putln("%s %s", f.MaskName, f.SrcType())
+ if f.ListComment != "" {
+ c.PutComment(f.ListComment)
+ }
c.Putln("%s []uint32", f.ListName)
}
@@ -197,6 +203,9 @@ func (f *ValueField) Write(c *Context, prefix string) {
// Switch field
func (f *SwitchField) Define(c *Context) {
+ if f.Comment != "" {
+ c.PutComment(f.Comment)
+ }
c.Putln("%s []uint32", f.Name)
}