Restructured type definitions to use a node tree

This commit is contained in:
Sasha Koshka
2022-08-18 23:38:32 -04:00
parent 717474a59e
commit 69aaae8f14
4 changed files with 27 additions and 23 deletions

View File

@@ -161,24 +161,19 @@ type DataSection struct {
value Argument
}
// TypeMember represents member data
type TypeMember struct {
// TypeNode represents a part of a type.
type TypeNode struct {
location file.Location
name string
what Type
permission types.Permission
defaultValue Argument
children map[string] TypeNode
}
// TypeSection represents a type definition.
type TypeSection struct {
location file.Location
name string
inherits Type
permission types.Permission
defaultValue Argument
// this should be 1 dimensional for now.
members map[string] TypeMember
root TypeNode
}