Language actually gets properly stepped through using debugger!

This commit is contained in:
Krzosa Karol
2022-06-07 17:53:04 +02:00
parent 9cdc5ee6c9
commit c69d2b7fe2
3 changed files with 36 additions and 0 deletions

View File

@@ -229,6 +229,11 @@ gen_expr(Ast_Expr *ast){
}
}
function void
gen_line(Ast *node){
genln("#line %d", node->pos->line+1);
}
function void
gen_ast(Ast *ast);
function void
@@ -236,6 +241,7 @@ gen_block(Ast_Block *block){
gen("{");
global_indent++;
For(block->stmts) {
gen_line(it);
genln("");
gen_ast(it);
}
@@ -248,7 +254,9 @@ gen_ast(Ast *ast){
switch(ast->kind){
CASE(PACKAGE, Package){
genln("#line 0 \"%s\"", node->name.str);
For(node->ordered) {
gen_line(it);
genln("");
gen_ast(it);
}