mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-31 11:50:07 +00:00
more fixes with wierd comment placements
This commit is contained in:
@@ -12,6 +12,9 @@ Type_Enum :: enum {Line_Comment, Value_Decl, Switch_Stmt, Struct, Assign, Call,
|
|||||||
|
|
||||||
Line_Type :: bit_set[Type_Enum];
|
Line_Type :: bit_set[Type_Enum];
|
||||||
|
|
||||||
|
/*
|
||||||
|
Represents an unwrapped line
|
||||||
|
*/
|
||||||
Line :: struct {
|
Line :: struct {
|
||||||
format_tokens: [dynamic]Format_Token,
|
format_tokens: [dynamic]Format_Token,
|
||||||
finalized: bool,
|
finalized: bool,
|
||||||
@@ -20,6 +23,9 @@ Line :: struct {
|
|||||||
types: Line_Type, //for performance, so you don't have to verify what types are in it by going through the tokens - might give problems when adding linebreaking
|
types: Line_Type, //for performance, so you don't have to verify what types are in it by going through the tokens - might give problems when adding linebreaking
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Represents an singular token in a unwrapped line
|
||||||
|
*/
|
||||||
Format_Token :: struct {
|
Format_Token :: struct {
|
||||||
kind: tokenizer.Token_Kind,
|
kind: tokenizer.Token_Kind,
|
||||||
text: string,
|
text: string,
|
||||||
@@ -474,12 +480,12 @@ align_var_decls :: proc(p: ^Printer) {
|
|||||||
not_mutable := false;
|
not_mutable := false;
|
||||||
continue_flag := false;
|
continue_flag := false;
|
||||||
|
|
||||||
for i := 0; i < len(line.format_tokens) - 1; i += 1 {
|
for i := 0; i < len(line.format_tokens); i += 1 {
|
||||||
if line.format_tokens[i].kind == .Colon && line.format_tokens[i + 1].kind == .Eq {
|
if line.format_tokens[i].kind == .Colon && line.format_tokens[min(i + 1, len(line.format_tokens) - 1)].kind == .Eq {
|
||||||
typed = false;
|
typed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if line.format_tokens[i].kind == .Colon && line.format_tokens[i + 1].kind == .Colon {
|
if line.format_tokens[i].kind == .Colon && line.format_tokens[min(i + 1, len(line.format_tokens) - 1)].kind == .Colon {
|
||||||
not_mutable = true;
|
not_mutable = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user