Backup, Decl,Type parsing enum,structs etc.

This commit is contained in:
Krzosa Karol
2022-04-29 23:28:41 +02:00
parent 9cbbb4d616
commit a5a3acf3ef
12 changed files with 407 additions and 45 deletions

7
main.c
View File

@@ -11,6 +11,10 @@
#include "expr.h"
#include "decl.h"
global FILE *global_output_file;
#define lex_print(...) fprintf(global_output_file, __VA_ARGS__)
#define lex_new_line() lex_print("\n")
#include "common.c"
#include "memory.c"
#include "parser.c"
@@ -99,6 +103,9 @@ parser_test(){
String decls[] = {
lit("enum Thing{ Thing_1, Thing_2 = 2}"),
lit("global S64 *variable[10] = 10"),
lit("global S64 (*variable)(S64 thing) = 10"),
lit("struct Thing{ S64 a; U64 *b; union A{ S64 thing; }; }"),
};
for(S64 i = 0; i < buff_cap(decls); i++){
parser_lex_stream(&p, decls[i], lit("File"));