Compare commits

...

2 Commits

Author SHA1 Message Date
Sasha Koshka 89a60e620e Altered objt section test case to not be alphabetically organized 2022-08-24 20:20:55 -04:00
Sasha Koshka cd528552c8 Object sections now parse members into array 2022-08-24 20:19:14 -04:00
2 changed files with 7 additions and 10 deletions

View File

@ -13,10 +13,7 @@ func (parser *ParsingOperation) parseObjtSection () (
err = parser.expect(lexer.TokenKindName)
if err != nil { return }
section = &ObjtSection {
location: parser.token.Location(),
members: make(map[string] ObjtMember),
}
section = &ObjtSection { location: parser.token.Location() }
// get permission
err = parser.nextToken(lexer.TokenKindPermission)
@ -68,7 +65,7 @@ func (parser *ParsingOperation) parseObjtMembers (
// add member to object section
var member ObjtMember
member, err = parser.parseObjtMember()
into.members[member.name] = member
into.members = append(into.members, member)
if err != nil { return }
}
}

View File

@ -13,17 +13,17 @@ objt ro BitFields:Obj
ro that:Int & 1
ro this:Int & 24 298
objt ro ComplexInit:Obj
ro basic:Int 87
ro whatever:{Int 3}
230984
849
394580
ro complex0:Bird
.that 98
.this 2
ro complex1:Bird
.that 98902
.this 235
ro whatever:{Int 3}
230984
849
394580
ro basic:Int 87
objt ro Init:Obj
ro that:String "hello world"
ro this:Int 23