+
+ case TOKEN_STRING: PARSE_TREE_ADD(PARSE_TYPE_STRING);
+ case TOKEN_VECTOR: PARSE_TREE_ADD(PARSE_TYPE_VECTOR);
+ case TOKEN_ENTITY: PARSE_TREE_ADD(PARSE_TYPE_ENTITY);
+ case TOKEN_FLOAT: PARSE_TREE_ADD(PARSE_TYPE_FLOAT);
+ /* fall into this for all types */
+ {
+ char *name = NULL;
+ TOKEN_SKIPWHITE();
+ name = util_strdup(file->lastok);
+ //token = lex_token (file);
+
+ /* is it NOT a definition? */
+ if (token != ';') {
+ while (token == ' ')
+ token = lex_token(file);
+
+ /* it's a function? */
+ if (token == '(') {
+ /*
+ * Now I essentially have to do a ton of parsing for
+ * function definition.
+ */
+ PARSE_TREE_ADD(PARSE_TYPE_LPARTH);
+ token = lex_token(file);
+ while (token != '\n' && token != ')') {
+ switch (token) {
+ case TOKEN_VOID: PARSE_TREE_ADD(PARSE_TYPE_VOID); break;
+ case TOKEN_STRING: PARSE_TREE_ADD(PARSE_TYPE_STRING); break;
+ case TOKEN_ENTITY: PARSE_TREE_ADD(PARSE_TYPE_ENTITY); break;
+ case TOKEN_FLOAT: PARSE_TREE_ADD(PARSE_TYPE_FLOAT); break;
+ /*
+ * TODO: Need to parse function pointers: I have no clue how
+ * I'm actually going to pull that off, it's going to be hard
+ * since you can have a function pointer-pointer-pointer ....
+ */
+ }
+ }
+ /* just a definition */
+ if (token == ')') {
+ /*
+ * I like to put my { on the same line as the ) for
+ * functions, ifs, elses, so we must support that!.
+ */
+ PARSE_TREE_ADD(PARSE_TYPE_RPARTH);
+ token = lex_token(file);
+ token = lex_token(file);
+ if(token == '{')
+ PARSE_TREE_ADD(PARSE_TYPE_LBS);
+ }
+ else if (token == '\n')
+ error(ERROR_COMPILER, "%s:%d Expecting `;` after function definition %s\n", file->name, file->line, name);
+
+ } else if (token == '=') {
+ PARSE_TREE_ADD(PARSE_TYPE_EQUAL);
+ } else {
+ error(ERROR_COMPILER, "%s:%d Invalid decltype: expected `(` [function], or `=` [constant] for %s\n", file->name, file->line, name);
+ }
+ } else {
+ /* definition */
+ printf("FOUND DEFINITION\n");
+ }
+ mem_d(name);
+ }