Altered syntax tree accordingly
🦀🦀🦀 Object sections are gone 🦀🦀🦀 and members are now stored in the type specifier.
This commit is contained in:
@@ -20,7 +20,6 @@ type SectionKind int
|
||||
|
||||
const (
|
||||
SectionKindType = iota
|
||||
SectionKindObjt
|
||||
SectionKindEnum
|
||||
SectionKindFace
|
||||
SectionKindData
|
||||
@@ -59,6 +58,17 @@ const (
|
||||
TypeKindVariableArray
|
||||
)
|
||||
|
||||
// TypeMember represents a member variable of a type specifier.
|
||||
type TypeMember struct {
|
||||
locatable
|
||||
nameable
|
||||
typeable
|
||||
permissionable
|
||||
valuable
|
||||
|
||||
bitWidth uint64
|
||||
}
|
||||
|
||||
// Type represents a type specifier
|
||||
type Type struct {
|
||||
locatable
|
||||
@@ -72,6 +82,9 @@ type Type struct {
|
||||
|
||||
// not applicable for basic.
|
||||
points *Type
|
||||
|
||||
// if non-nil, this type defines new members.
|
||||
members []TypeMember
|
||||
}
|
||||
|
||||
// Declaration represents a variable declaration.
|
||||
@@ -173,7 +186,7 @@ type DataSection struct {
|
||||
external bool
|
||||
}
|
||||
|
||||
// TypeSection represents a blind type definition.
|
||||
// TypeSection represents a type definition.
|
||||
type TypeSection struct {
|
||||
locatable
|
||||
nameable
|
||||
@@ -182,27 +195,6 @@ type TypeSection struct {
|
||||
valuable
|
||||
}
|
||||
|
||||
// ObjtMember represents a part of an object type definition.
|
||||
type ObjtMember struct {
|
||||
locatable
|
||||
nameable
|
||||
typeable
|
||||
permissionable
|
||||
valuable
|
||||
|
||||
bitWidth uint64
|
||||
}
|
||||
|
||||
// ObjtSection represents an object type definition.
|
||||
type ObjtSection struct {
|
||||
locatable
|
||||
nameable
|
||||
permissionable
|
||||
inherits Identifier
|
||||
|
||||
members []ObjtMember
|
||||
}
|
||||
|
||||
// EnumMember represents a member of an enum section.
|
||||
type EnumMember struct {
|
||||
locatable
|
||||
|
||||
Reference in New Issue
Block a user