1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

fmt: initial support for -debug

This commit is contained in:
Delyan Angelov
2020-05-04 17:22:41 +03:00
parent 23df9b052e
commit 5eb71c4a13
5 changed files with 18 additions and 8 deletions

View File

@ -152,7 +152,7 @@ fn (foptions &FormatOptions) format_file(file string) {
parent: 0
})
// checker.check(file_ast)
formatted_content := fmt.fmt(file_ast, table)
formatted_content := fmt.fmt(file_ast, table, foptions.is_debug)
file_name := os.file_name(file)
vfmt_output_path := os.join_path(os.temp_dir(), 'vfmt_' + file_name)
os.write_file(vfmt_output_path, formatted_content)

View File

@ -9,7 +9,9 @@ Options:
-diff Display only diffs between the formatted source and the original source.
-l List files whose formatting differs from vfmt.
-w Write result to (source) file(s) instead of to stdout.
-2 Use the new V parser/vfmt. NB: this is EXPERIMENTAL for now.
The new vfmt is much faster and more forgiving.
It also may EAT some of your code for now.
Please be careful, and make frequent BACKUPS, when running with -vfmt2 .
-debug Print the kinds of encountered AST statements/expressions on stderr.
NB: vfmt after 2020/04/01 is based on the new AST compiler code, and
thus is much faster, and more flexible than before.
It may also EAT some of your code for now, so please be careful, and
make frequent BACKUPS.