mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-07 16:18:52 +00:00
Added a bool flag to the Block_Stmt struct to have information whether or not 'do' was used vs brackets in the AST
This commit is contained in:
@@ -282,6 +282,7 @@ Block_Stmt :: struct {
|
|||||||
open: tokenizer.Pos,
|
open: tokenizer.Pos,
|
||||||
stmts: []^Stmt,
|
stmts: []^Stmt,
|
||||||
close: tokenizer.Pos,
|
close: tokenizer.Pos,
|
||||||
|
uses_do: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
If_Stmt :: struct {
|
If_Stmt :: struct {
|
||||||
|
|||||||
@@ -1217,6 +1217,7 @@ convert_stmt_to_body :: proc(p: ^Parser, stmt: ^ast.Stmt) -> ^ast.Stmt {
|
|||||||
bs.stmts = make([]^ast.Stmt, 1);
|
bs.stmts = make([]^ast.Stmt, 1);
|
||||||
bs.stmts[0] = stmt;
|
bs.stmts[0] = stmt;
|
||||||
bs.close = stmt.end;
|
bs.close = stmt.end;
|
||||||
|
bs.uses_do = true;
|
||||||
return bs;
|
return bs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user