Writing more real program and squashing bugs
This commit is contained in:
10
parsing.cpp
10
parsing.cpp
@@ -402,9 +402,9 @@ binding_power(Binding binding, Token_Kind kind){
|
||||
case TK_Mod:
|
||||
return {17,18};
|
||||
case TK_Dot:
|
||||
return {24,23};
|
||||
case TK_Arrow:
|
||||
return {31,30};
|
||||
case TK_Arrow:
|
||||
return {29,28};
|
||||
default: return {};
|
||||
}
|
||||
Postfix: switch(kind){
|
||||
@@ -605,6 +605,7 @@ register_ast_file(Intern_String filename, Ast_Module *module, B32 global_implici
|
||||
file = result;
|
||||
file->filename = filename;
|
||||
file->module = module;
|
||||
file->parent_scope = 0;
|
||||
file->file = file; // @warning: self referential!
|
||||
file->decls = {pctx->heap};
|
||||
file->implicit_imports = {pctx->heap};
|
||||
@@ -657,6 +658,8 @@ parse_decl(B32 is_global){
|
||||
Ast_Flag flags = 0;
|
||||
if(token_match_pound(intern_foreign)){
|
||||
set_flag(flags, AST_FOREIGN);
|
||||
} else if(token_match_pound(intern_strict)){
|
||||
set_flag(flags, AST_STRICT);
|
||||
}
|
||||
|
||||
// @note parse struct binding
|
||||
@@ -685,7 +688,8 @@ parse_decl(B32 is_global){
|
||||
if(expr->kind == AST_LAMBDA_EXPR){
|
||||
auto a = (Ast_Lambda *)expr;
|
||||
if(a->scope || is_flag_set(flags, AST_FOREIGN)){
|
||||
set_flag(result->flags, flags);
|
||||
if(is_flag_set(flags, AST_FOREIGN))
|
||||
set_flag(expr->flags, flags);
|
||||
result->kind = AST_LAMBDA;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user