aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/parser.h22
-rw-r--r--src/include/tree.h6
2 files changed, 9 insertions, 19 deletions
diff --git a/src/include/parser.h b/src/include/parser.h
index 694bd5e..0ba2038 100644
--- a/src/include/parser.h
+++ b/src/include/parser.h
@@ -13,37 +13,25 @@ parser_t* parser_init(lexer_t* lexer);
void parser_destroy(parser_t* parser);
// expect token, or die
-void parser_token_expect(parser_t* parser, token_t* token);
+void parser_token_expect(parser_t* parser, int token);
void parser_token_expectf(parser_t* parser, int (*expected_token)(token_t*));
// do the parse
tree_t* parser_parse(parser_t* parser);
-// parse statements
-// - end in semicolon or ) or }
-// - can contain one expression
-// - return what they evaluate to
-tree_t* parser_parse_statements(parser_t* parser);
-tree_t* parser_parse_statement(parser_t* parser);
-
// parse expressions
-// - in parenthetical
-// - contain only one statement
-// - return what that statement evaluates to
-// - adds layer of scope)
-// basically a statement, but with a layer of scope
+// - returns what it evaluates to
+// - can contain other exprs
tree_t* parser_parse_exprs(parser_t* parser);
tree_t* parser_parse_expr(parser_t* parser);
// parse blocks
// - in curly brackets
-// - many statements
-// - return what last statement evaluates to
+// - contains many exprs
+// - returns last expr
tree_t* parser_parse_blocks(parser_t* parser);
tree_t* parser_parse_block(parser_t* parser);
-// blocks contain many statements, any of which may contain any number of expressions
-
tree_t* parser_parse_def(parser_t* parser);
tree_t* parser_parse_call(parser_t* parser);
diff --git a/src/include/tree.h b/src/include/tree.h
index 6374062..fde66ea 100644
--- a/src/include/tree.h
+++ b/src/include/tree.h
@@ -19,9 +19,11 @@ typedef struct TREE_STRUC {
} comp;
struct { // === DEFINITIONS ===
- char* name; // name of definition
- int mutability; // mutability of definition
+ char* type; // the definition type
+ char** tags; // the definition tags
+ char* name; // the definition name
struct TREE_STRUC* value; // value of definition
+ // :D lines line up :D
} def;
struct { // === CALLS ===