parseType method now understands arrays with undefined length
This commit is contained in:
parent
97cb6e54eb
commit
210e527b3a
@ -90,7 +90,8 @@ func (parser *ParsingOperation) parseType () (what Type, err error) {
|
||||
|
||||
err = parser.expect (
|
||||
lexer.TokenKindUInt,
|
||||
lexer.TokenKindRBrace)
|
||||
lexer.TokenKindRBrace,
|
||||
lexer.TokenKindElipsis)
|
||||
if err != nil { return }
|
||||
|
||||
if parser.token.Is(lexer.TokenKindUInt) {
|
||||
@ -98,6 +99,11 @@ func (parser *ParsingOperation) parseType () (what Type, err error) {
|
||||
|
||||
what.length = parser.token.Value().(uint64)
|
||||
|
||||
err = parser.nextToken(lexer.TokenKindRBrace)
|
||||
if err != nil { return }
|
||||
} else if parser.token.Is(lexer.TokenKindElipsis) {
|
||||
what.kind = TypeKindArray
|
||||
|
||||
err = parser.nextToken(lexer.TokenKindRBrace)
|
||||
if err != nil { return }
|
||||
}
|
||||
|
Reference in New Issue
Block a user