Type section now passes test

This commit is contained in:
Sasha Koshka 2022-09-29 02:13:22 -04:00
parent 23072b5476
commit 011c968192
2 changed files with 17 additions and 25 deletions

View File

@ -186,10 +186,10 @@ func (section DataSection) ToString (indent int) (output string) {
func (member TypeSectionMember) ToString (indent int) (output string) { func (member TypeSectionMember) ToString (indent int) (output string) {
output += doIndent(indent, member.permission.ToString()) output += doIndent(indent, member.permission.ToString())
output += " " + member.name
if member.what.kind != TypeKindNil { if member.what.kind != TypeKindNil {
output += " " + member.name + ":" output += ":" + member.what.ToString()
output += member.what.ToString()
} }
if member.argument.kind != ArgumentKindNil { if member.argument.kind != ArgumentKindNil {

View File

@ -9,39 +9,31 @@ func TestType (test *testing.T) {
type ro aBasic:Obj type ro aBasic:Obj
ro that:Int ro that:Int
ro this:Int ro this:Int
type ro bBitFields:Obj type ro bBitFields:Obj
ro that:Int & 1 ro that:Int & 1
ro this:Int ro this:Int 298 & 24
298 & 24
type ro cInit:Obj type ro cInit:Obj
ro that:String ro that:String "hello world"
"hello world" ro this:Int 23
ro this:Int
23
type ro dInitInherit:aBasic type ro dInitInherit:aBasic
ro that ro that 9384
9384 ro this 389
ro this
389
type ro eInitAndDefine:aBasic type ro eInitAndDefine:aBasic
ro this ro this 389
389 ro that 9384
ro that ro born:Int 4
9384
ro born:Int
4
ro in:Int ro in:Int
ro the:Int:3 ro the:Int:3 (9348 92384 92834)
(9348 92384 92834) ro walls:String "live in the walls, die in the walls."
ro walls:String
"live in the walls, die in the walls."
type ro fBasic:Int type ro fBasic:Int
type ro gBasicInit:Int type ro gBasicInit:Int
6 6
type ro hIntArray:{Int ..} type ro hIntArray:{Int ..}
type ro iIntArrayInit:Int:3 type ro iIntArrayInit:Int:3
(3298 923 92) (
3298
923
92
)
`, test) `, test)
} }