generate: Add option type to parser
This commit is contained in:
@@ -214,12 +214,19 @@ func (this *parser) parseField(doc string) (uint16, Field, error) {
|
||||
name := this.Value()
|
||||
err = this.Next()
|
||||
if err != nil { return 0, Field { }, err }
|
||||
option := false
|
||||
if this.Kind() == TokenOption {
|
||||
option = true
|
||||
err = this.Next()
|
||||
if err != nil { return 0, Field { }, err }
|
||||
}
|
||||
typ, err := this.parseType()
|
||||
if err != nil { return 0, Field { }, err }
|
||||
return uint16(key), Field {
|
||||
Name: name,
|
||||
Doc: doc,
|
||||
Type: typ,
|
||||
Name: name,
|
||||
Doc: doc,
|
||||
Type: typ,
|
||||
Option: option,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user