Fixed some errors that cropped up in the data section test

This commit is contained in:
Sasha Koshka 2022-09-17 11:50:27 -04:00
parent 8b8754a12d
commit bd25006897
3 changed files with 8 additions and 8 deletions

View File

@ -26,8 +26,8 @@ data ro gIntegerArrayInitialized:Int:16:
4785 4785
92 92
> >
data wr hIntegerPointerInit:{Int}:<[& integer]> data rw hIntegerPointerInit:{Int}:<[& integer]>
data wr iMutIntegerPointerInit:{Int}:mut:<[& integer]> data rw iMutIntegerPointerInit:{Int}:mut:<[& integer]>
data ro jObject:Obj: data ro jObject:Obj:
( (
.that:<324> .that:<324>

View File

@ -6,10 +6,7 @@ import "git.tebibyte.media/arf/arf/types"
// parseType parses a type notation of the form Name, {Name}, etc. // parseType parses a type notation of the form Name, {Name}, etc.
func (parser *ParsingOperation) parseType () (what Type, err error) { func (parser *ParsingOperation) parseType () (what Type, err error) {
println("START")
defer println("END")
err = parser.expect(lexer.TokenKindName, lexer.TokenKindLBrace) err = parser.expect(lexer.TokenKindName, lexer.TokenKindLBrace)
println(parser.token.Describe())
if err != nil { return } if err != nil { return }
what.location = parser.token.Location() what.location = parser.token.Location()
@ -50,7 +47,7 @@ func (parser *ParsingOperation) parseType () (what Type, err error) {
if err != nil { return } if err != nil { return }
err = parser.skipWhitespace() err = parser.skipWhitespace()
if err != nil { return } if err != nil { return }
err = parser.expect( err = parser.expect(
lexer.TokenKindName, lexer.TokenKindName,
lexer.TokenKindUInt, lexer.TokenKindUInt,
@ -71,6 +68,9 @@ func (parser *ParsingOperation) parseType () (what Type, err error) {
infoerr.ErrorKindError) infoerr.ErrorKindError)
return return
} }
err = parser.nextToken()
if err != nil { return }
} else if parser.token.Is(lexer.TokenKindUInt) { } else if parser.token.Is(lexer.TokenKindUInt) {
// parse fixed array length // parse fixed array length
what.length = parser.token.Value().(uint64) what.length = parser.token.Value().(uint64)

View File

@ -18,9 +18,9 @@ data ro gIntegerArrayInitialized:Int:16:<
340 0 2304 0 4785 92 340 0 2304 0 4785 92
> >
data wr hIntegerPointerInit:{Int}:<[& integer]> data rw hIntegerPointerInit:{Int}:<[& integer]>
data wr iMutIntegerPointerInit:{Int}:mut:<[& integer]> data rw iMutIntegerPointerInit:{Int}:mut:<[& integer]>
data ro jObject:Obj:( data ro jObject:Obj:(
.this:<324> .this:<324>