diff options
author | Kyle Gunger <kgunger12@gmail.com> | 2021-10-29 20:13:30 -0400 |
---|---|---|
committer | Kyle Gunger <kgunger12@gmail.com> | 2021-10-29 20:13:30 -0400 |
commit | ad506ec1d0f465f55e66a220cb7a04164a348212 (patch) | |
tree | e05f7c1837b145b8312642fc4a4cd2b609bbbb66 /src | |
parent | a5a9f99b735c9ccb7968785692c3b65404a5233d (diff) |
[AST] Def checking
Add some placeholder code
Diffstat (limited to 'src')
-rw-r--r-- | src/tparse/tree-statement.go | 4 | ||||
-rw-r--r-- | src/tparse/tree-value.go | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/tparse/tree-statement.go b/src/tparse/tree-statement.go index bb8bde2..9a4a515 100644 --- a/src/tparse/tree-statement.go +++ b/src/tparse/tree-statement.go @@ -108,9 +108,9 @@ func parseStatement(tokens *[]Token, tok, max int) (Node, int) { out.Sub = append(out.Sub, tmp) } else { // do check for definition - if false { + if isTypeThenValue { // if not, parse a value - tmp, tok = parseDefinition(tokens, tok, max) + tmp, tok = parseDef(tokens, tok, max) } else { // if not, parse a value tmp, tok = parseValue(tokens, tok, max) diff --git a/src/tparse/tree-value.go b/src/tparse/tree-value.go index af547a5..f8bd197 100644 --- a/src/tparse/tree-value.go +++ b/src/tparse/tree-value.go @@ -389,3 +389,10 @@ func parseType(tokens *[]Token, tok, max int, param bool) (Node, int) { return out, tok } + + +func isTypeThenValue(tokens *[]Token, tok, max int) (bool) { + //TODO: check for a standard type and then a value + + return true +}
\ No newline at end of file |