generate: Parse Bool type

This commit is contained in:
Sasha Koshka 2025-10-15 00:31:54 -04:00
parent 2ee954e18f
commit 770f6b05b4
2 changed files with 3 additions and 0 deletions

View File

@ -132,6 +132,7 @@ func (this *parser) parseType() (Type, error) {
case "Buffer": return TypeBuffer { }, this.Next()
case "Table": return TypeTable { }, this.Next()
case "Any": return TypeAny { }, this.Next()
case "Bool": return TypeBool { }, this.Next()
}
return this.parseTypeNamed()
case TokenLBracket:

View File

@ -33,6 +33,7 @@ func TestParse(test *testing.T) {
0x0000: Field { Name: "Name", Type: TypeString { } },
0x0001: Field { Name: "Bio", Type: TypeString { } },
0x0002: Field { Name: "Followers", Type: TypeInt { Bits: 32 } },
0x0003: Field { Name: "Bouncy", Type: TypeBool { } },
},
},
}
@ -61,6 +62,7 @@ func TestParse(test *testing.T) {
0000 Name String,
0001 Bio String,
0002 Followers U32,
0003 Bouncy Bool,
}
Anything Any