generate: Add comments to protocol data structures, tests
This commit is contained in:
@@ -21,7 +21,7 @@ func Parse(lx parse.Lexer) (*Protocol, error) {
|
||||
func defaultProtocol() Protocol {
|
||||
return Protocol {
|
||||
Messages: make(map[uint16] Message),
|
||||
Types: map[string] Type { },
|
||||
Types: map[string] Typedef { },
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,6 +72,7 @@ func (this *parser) parseMessage() error {
|
||||
if err != nil { return err }
|
||||
this.protocol.Messages[uint16(method)] = Message {
|
||||
Name: name,
|
||||
// TODO: doc
|
||||
Type: typ,
|
||||
}
|
||||
return nil
|
||||
@@ -85,7 +86,10 @@ func (this *parser) parseTypedef() error {
|
||||
if err != nil { return err }
|
||||
typ, err := this.parseType()
|
||||
if err != nil { return err }
|
||||
this.protocol.Types[name] = typ
|
||||
this.protocol.Types[name] = Typedef {
|
||||
// TODO: doc
|
||||
Type: typ,
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -192,6 +196,7 @@ func (this *parser) parseField() (uint16, Field, error) {
|
||||
if err != nil { return 0, Field { }, err }
|
||||
return uint16(key), Field {
|
||||
Name: name,
|
||||
// TODO: doc
|
||||
Type: typ,
|
||||
}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user