Compile string, working on scopes

This commit is contained in:
Krzosa Karol
2022-05-25 15:17:08 +02:00
parent b945f3affd
commit f4c05923c9
9 changed files with 125 additions and 136 deletions

View File

@@ -35,6 +35,8 @@ struct Parse_Ctx:Lexer{
Token empty_token;
S64 indent;
String_Builder gen;
Intern_String intern(String string){
return intern_string(&interns, string);
}
@@ -43,6 +45,7 @@ struct Parse_Ctx:Lexer{
perm = perm_allocator;
heap = heap_allocator;
gen = {perm};
resolved = {heap};
syms = {heap};
type_map = {heap};
@@ -202,10 +205,10 @@ function Ast_Typespec *ast_typespec_name(Token *pos, Intern_String name);
//-----------------------------------------------------------------------------
// AST Constructors beginning with expressions
//-----------------------------------------------------------------------------
#define AST_NEW(T,ikind,ipos) \
Ast_##T *result = exp_alloc_type(pctx->perm, Ast_##T); \
result->kind = ikind; \
result->pos = ipos; \
#define AST_NEW(T,ikind,ipos) \
Ast_##T *result = exp_alloc_type(pctx->perm, Ast_##T, AF_ZeroMemory);\
result->kind = ikind; \
result->pos = ipos; \
result->id = ++pctx->unique_ids
function Ast_Atom *