mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
better placing of the end brace
This commit is contained in:
@@ -907,3 +907,4 @@ align_comments :: proc(p: ^Printer) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -9,7 +9,7 @@ import "core:unicode/utf8"
|
|||||||
import "core:mem"
|
import "core:mem"
|
||||||
import "core:sort"
|
import "core:sort"
|
||||||
|
|
||||||
//right the attribute order is not linearly parsed(bug?)
|
//right now the attribute order is not linearly parsed(bug?)
|
||||||
@(private)
|
@(private)
|
||||||
sort_attribute :: proc(s: ^[dynamic]^ast.Attribute) -> sort.Interface {
|
sort_attribute :: proc(s: ^[dynamic]^ast.Attribute) -> sort.Interface {
|
||||||
return sort.Interface {
|
return sort.Interface {
|
||||||
@@ -576,8 +576,6 @@ visit_stmt :: proc(p: ^Printer, stmt: ^ast.Stmt, block_type: Block_Type = .Gener
|
|||||||
|
|
||||||
visit_block_stmts(p, v.stmts, len(v.stmts) > 1 && p.config.split_multiple_stmts);
|
visit_block_stmts(p, v.stmts, len(v.stmts) > 1 && p.config.split_multiple_stmts);
|
||||||
|
|
||||||
set_source_position(p, v.end);
|
|
||||||
|
|
||||||
if !empty_block {
|
if !empty_block {
|
||||||
visit_end_brace(p, v.end);
|
visit_end_brace(p, v.end);
|
||||||
}
|
}
|
||||||
@@ -1259,8 +1257,7 @@ visit_begin_brace :: proc(p: ^Printer, begin: tokenizer.Pos, type: Block_Type, c
|
|||||||
}
|
}
|
||||||
|
|
||||||
visit_end_brace :: proc(p: ^Printer, end: tokenizer.Pos) {
|
visit_end_brace :: proc(p: ^Printer, end: tokenizer.Pos) {
|
||||||
set_source_position(p, end);
|
move_line(p, end);
|
||||||
newline_position(p, 1);
|
|
||||||
push_generic_token(p, .Close_Brace, 0);
|
push_generic_token(p, .Close_Brace, 0);
|
||||||
unindent(p);
|
unindent(p);
|
||||||
p.current_line.depth = p.depth;
|
p.current_line.depth = p.depth;
|
||||||
|
|||||||
Reference in New Issue
Block a user