summaryrefslogtreecommitdiff
path: root/src/tparse/tree.go
diff options
context:
space:
mode:
authorKyle Gunger <corechg@gmail.com>2020-07-08 17:02:34 -0400
committerKyle Gunger <corechg@gmail.com>2020-07-08 17:02:34 -0400
commit8db6eccbd4678305bf7fcb66effa1a57d929db34 (patch)
treef5d4059fb81291329d33767436403e2090b62525 /src/tparse/tree.go
parent08fabe9627d89b9811b0fafe1c2bb11773d02bbc (diff)
Update tree structure
Diffstat (limited to 'src/tparse/tree.go')
-rw-r--r--src/tparse/tree.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/tparse/tree.go b/src/tparse/tree.go
index 41896fc..48c198c 100644
--- a/src/tparse/tree.go
+++ b/src/tparse/tree.go
@@ -10,9 +10,15 @@ type Node struct {
// Directive represents a block or single directive
type Directive struct {
Type string
- ID string
+ Data string
- Data []string
+ Param Paramaters
+}
+
+// Paramaters represents a set of paramaters for a directive
+type Paramaters struct {
+ In []string
+ Out []string
}
func handleCode(tokens *[]Token, start int) (Node, int) {
@@ -30,7 +36,7 @@ func handlePre(tokens *[]Token, start int) (Node, int) {
// CreateTree takes a series of tokens and converts them into an AST
func CreateTree(tokens *[]Token, start int) Node {
out := Node{}
- out.Dir = Directive{Type: "root", ID: "root"}
+ out.Dir = Directive{Type: "root"}
var tmp Node