Added untested bit width parsing

This commit is contained in:
Sasha Koshka 2022-08-24 18:29:15 -04:00
parent 05aa0e6177
commit 731cc828ce
2 changed files with 10 additions and 1 deletions

View File

@ -96,6 +96,15 @@ func (parser *ParsingOperation) parseObjtMember () (
if err != nil { return }
member.what, err = parser.parseType()
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
if parser.token.Is(lexer.TokenKindNewline) {

View File

@ -180,7 +180,7 @@ type ObjtMember struct {
name string
what Type
bitWidth int
bitWidth uint64
permission types.Permission
defaultValue Argument
}