From 222c47ced904e9facba4465b64c37a50b02f9ef0 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Sat, 20 Aug 2022 02:46:40 -0400 Subject: [PATCH] Altered tree to separate object and blind type definitions --- parser/tree.go | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/parser/tree.go b/parser/tree.go index 63f885d..d8f502e 100644 --- a/parser/tree.go +++ b/parser/tree.go @@ -161,19 +161,32 @@ type DataSection struct { value Argument } -// TypeNode represents a part of a type. -type TypeNode struct { +// TypeSection represents a blind type definition. +type TypeSection 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 { +// ObjtSection represents an object type definition +type ObjtSection struct { location file.Location - root TypeNode + name string + + what Type + permission types.Permission + children map[string] ObjtMember +} + +// ObjtMember represents a part of an object type definition. +type ObjtMember struct { + location file.Location + name string + + what Type + permission types.Permission + defaultValue Argument }