mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-04 14:48:47 +00:00
Correct newline_limit logic
This commit is contained in:
@@ -11,6 +11,8 @@ simplify :: proc(file: ^ast.File) {
|
||||
}
|
||||
|
||||
format :: proc(filepath: string, source: string, config: printer.Config, parser_flags := parser.Flags{}, allocator := context.allocator) -> (string, bool) {
|
||||
config := config;
|
||||
|
||||
pkg := ast.Package {
|
||||
kind = .Normal,
|
||||
};
|
||||
@@ -21,6 +23,10 @@ format :: proc(filepath: string, source: string, config: printer.Config, parser_
|
||||
fullpath = filepath,
|
||||
};
|
||||
|
||||
config.newline_limit = clamp(config.newline_limit, 0, 16);
|
||||
config.spaces = clamp(config.spaces, 1, 16);
|
||||
config.align_length_break = clamp(config.align_length_break, 0, 64);
|
||||
|
||||
p := parser.default_parser(parser_flags);
|
||||
|
||||
ok := parser.parse_file(&p, &file);
|
||||
|
||||
Reference in New Issue
Block a user