Added untested bit width parsing
This commit is contained in:
parent
05aa0e6177
commit
731cc828ce
@ -97,6 +97,15 @@ func (parser *ParsingOperation) parseObjtMember () (
|
|||||||
member.what, err = parser.parseType()
|
member.what, err = parser.parseType()
|
||||||
if err != nil { return }
|
if err != nil { return }
|
||||||
|
|
||||||
|
// if there is a bit width, get it
|
||||||
|
if parser.token.Is(lexer.TokenKindColon) {
|
||||||
|
err = parser.nextToken(lexer.TokenKindUInt)
|
||||||
|
if err != nil { return }
|
||||||
|
member.bitWidth = parser.token.Value().(uint64)
|
||||||
|
err = parser.nextToken()
|
||||||
|
if err != nil { return }
|
||||||
|
}
|
||||||
|
|
||||||
// parse default value
|
// parse default value
|
||||||
if parser.token.Is(lexer.TokenKindNewline) {
|
if parser.token.Is(lexer.TokenKindNewline) {
|
||||||
err = parser.nextToken()
|
err = parser.nextToken()
|
||||||
|
@ -180,7 +180,7 @@ type ObjtMember struct {
|
|||||||
name string
|
name string
|
||||||
|
|
||||||
what Type
|
what Type
|
||||||
bitWidth int
|
bitWidth uint64
|
||||||
permission types.Permission
|
permission types.Permission
|
||||||
defaultValue Argument
|
defaultValue Argument
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user