Core: New unique_name scheme, more human friendly
This commit is contained in:
@@ -298,6 +298,10 @@ parse_stmt_scope(Ast_Scope *scope_defined_outside = 0) {
|
||||
scope->stmts.add(ast_continue(token));
|
||||
}
|
||||
|
||||
else if (token_match_keyword(pctx->keyword___compilerbreakpoint)) {
|
||||
scope->stmts.add(ast_compiler_breakpoint(token));
|
||||
}
|
||||
|
||||
else if (token_match_keyword(pctx->keyword_break)) {
|
||||
scope->stmts.add(ast_break(token));
|
||||
}
|
||||
@@ -483,6 +487,7 @@ parse_parameter_list(Arena *arena) {
|
||||
|
||||
Ast_Decl *param = ast_new(Ast_Decl, AST_VAR, name, AST_DECL);
|
||||
param->name = name->intern_val;
|
||||
param->unique_name = name->intern_val;
|
||||
param->typespec = parse_expr();
|
||||
set_flag_typespec(param->typespec);
|
||||
if (is_typespec_polymorphic(param->typespec)) {
|
||||
@@ -921,11 +926,13 @@ parse_decl(B32 is_global) {
|
||||
|
||||
else if (token_match_pound(pctx->intern_load)) {
|
||||
Ast_File *file = parse_load(false);
|
||||
if (file->first_namespace_name.len == 0) file->first_namespace_name = tname->intern_val;
|
||||
result = ast_namespace(tname, file, tname->intern_val);
|
||||
}
|
||||
|
||||
else if (token_match_pound(pctx->intern_import)) {
|
||||
Ast_Module *module = parse_import(false);
|
||||
if (module->first_namespace_name.len == 0) module->first_namespace_name = tname->intern_val;
|
||||
result = ast_namespace(tname, module, tname->intern_val);
|
||||
}
|
||||
|
||||
@@ -940,7 +947,7 @@ parse_decl(B32 is_global) {
|
||||
auto lambda = (Ast_Lambda *)expr;
|
||||
if (lambda->scope || is_flag_set(flags, AST_FOREIGN)) {
|
||||
result->kind = AST_LAMBDA;
|
||||
lambda->scope->parent_decl = result;
|
||||
if (lambda->scope) lambda->scope->parent_decl = result;
|
||||
if (is_flag_set(lambda->flags, AST_POLYMORPH)) {
|
||||
set_flag(result->flags, AST_POLYMORPH);
|
||||
set_flag(result->flags, AST_PARENT_POLYMORPH);
|
||||
|
||||
Reference in New Issue
Block a user