summaryrefslogtreecommitdiff
path: root/src/tparse
diff options
context:
space:
mode:
Diffstat (limited to 'src/tparse')
-rw-r--r--src/tparse/tree.go12
-rw-r--r--src/tparse/type.go2
2 files changed, 11 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
diff --git a/src/tparse/type.go b/src/tparse/type.go
index dc0df10..735f681 100644
--- a/src/tparse/type.go
+++ b/src/tparse/type.go
@@ -40,6 +40,8 @@ var RESWORD = map[string]int{
"int": KEYTYPE,
"float": KEYTYPE,
+ "string": KEYTYPE,
+
"struct": KEYWORD,
"type": KEYWORD,