Correct newline_limit logic
This commit is contained in:
1 parent
f0c9f82e1b
commit
9e2eb717fe
4 files changed
+26
-53
No files matched your search
@@ -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