aboutsummaryrefslogtreecommitdiff
path: root/src/parser.c
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-02-14 15:19:29 +0000
committerGinger Bill <bill@gingerbill.org>2017-02-14 15:19:29 +0000
commitd1f65097c48afe6d869949cc5ede76a8b14401a9 (patch)
tree6ff3ef199e46edd8998d7492361c52d188be1df6 /src/parser.c
parent74d15ab84b39a83285953b963f1637956f091f45 (diff)
Fix immutable rules; add some general documentation
immutable is still a little weird and not completely what you'd expect. Maybe just not having it is better.
Diffstat (limited to 'src/parser.c')
-rw-r--r--src/parser.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/parser.c b/src/parser.c
index 69ea32c48..fedde531e 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -111,7 +111,9 @@ AstNodeArray make_ast_node_array(AstFile *f) {
}
-
+// NOTE(bill): This massive define is so it is possible to create a discriminated union (and extra debug info)
+// for the AstNode. I personally prefer discriminated unions over subtype polymorphism as I can preallocate
+// all the nodes and even memcpy in a different kind of node
#define AST_NODE_KINDS \
AST_NODE_KIND(Ident, "identifier", Token) \
AST_NODE_KIND(Implicit, "implicit", Token) \