C codegen
This commit is contained in:
17
main.c
17
main.c
@@ -26,6 +26,7 @@ global FILE *global_output_file;
|
||||
#include "parse_expr.c"
|
||||
#include "parse_decl.c"
|
||||
#include "print.c"
|
||||
#include "codegen_c.c"
|
||||
|
||||
function void
|
||||
lex_test(){
|
||||
@@ -96,24 +97,16 @@ parser_test(){
|
||||
parser_lex_stream(&p, exprs[i], lit("File"));
|
||||
Expr *expr = parse_expr(&p);
|
||||
assert(expr);
|
||||
expr_print(&p, expr);
|
||||
lex_print("\n");
|
||||
//expr_print(&p, expr);
|
||||
//lex_print("\n");
|
||||
}
|
||||
|
||||
/*
|
||||
String string
|
||||
= lit(
|
||||
"@test Thing2 :: struct { thing: union{a:U32;}; _: union{ thing: U32*; }; }"
|
||||
"Thing :: enum: U32 { @str=\"as\" Thing = 32, Thing2 = 15<<2, }"
|
||||
"Thing :: struct{ identi: U64*[32]; InnerStruct :: struct { t: U32; } var: InnerStruct; pp :: enum { Thing_1 } }"
|
||||
"thing:(S64*,U64) U32*@[10]; }"
|
||||
);
|
||||
*/
|
||||
String string = os_read_file(lit("test.cc"));
|
||||
parser_lex_stream(&p, string, lit("Parse"));
|
||||
Decl *decls = parse(&p);
|
||||
assert(decls->list.first);
|
||||
print_decl(&p, decls);
|
||||
gen_decl(&p, decls);
|
||||
|
||||
}
|
||||
|
||||
function S32
|
||||
|
||||
Reference in New Issue
Block a user