From cd55a0ad8d635ca27cf4268175b1edfd8025b1e7 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Tue, 23 Aug 2022 10:56:37 -0400 Subject: [PATCH] Add interface section to tree --- parser/tree.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/parser/tree.go b/parser/tree.go index 559dbc8..f10a5e5 100644 --- a/parser/tree.go +++ b/parser/tree.go @@ -14,6 +14,7 @@ type SyntaxTree struct { typeSections map[string] *TypeSection objtSections map[string] *ObjtSection enumSections map[string] *EnumSection + faceSections map[string] *FaceSection dataSections map[string] *DataSection } @@ -203,3 +204,22 @@ type EnumSection struct { // TODO: order matters here we need to store these in an array members map[string] Argument } + +// FaceBehavior represents a behavior of an interface section. +type FaceBehavior struct { + location file.Location + name string + + inputs []Declaration + outputs []Declaration +} + +// FaceSection represents an interface type section. +type FaceSection struct { + location file.Location + name string + + what Type + permission types.Permission + behaviors map[string] FaceBehavior +}