Skip to content

Commit 2ac3478

Browse files
authored
vfmt,parser: move mark used from vfmt to parser (#25190)
1 parent 24f9128 commit 2ac3478

9 files changed

Lines changed: 150 additions & 205 deletions

File tree

‎vlib/v/ast/ast.v‎

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,22 +1011,25 @@ pub:
10111011
is_translated bool // true for `@[translated] module xyz` files; turn off some checks
10121012
language Language
10131013
pub mut:
1014-
idx int // index in an external container; can be used to refer to the file in a more efficient way, just by its integer index
1015-
path string // absolute path of the source file - '/projects/v/file.v'
1016-
path_base string // file name - 'file.v' (useful for tracing)
1017-
scope &Scope = unsafe { nil }
1018-
stmts []Stmt // all the statements in the source file
1019-
imports []Import // all the imports
1020-
auto_imports []string // imports that were implicitly added
1021-
embedded_files []EmbeddedFile // list of files to embed in the binary
1022-
imported_symbols map[string]string // used for `import {symbol}`, it maps symbol => module.symbol
1023-
errors []errors.Error // all the checker errors in the file
1024-
warnings []errors.Warning // all the checker warnings in the file
1025-
notices []errors.Notice // all the checker notices in the file
1026-
generic_fns []&FnDecl
1027-
global_labels []string // from `asm { .globl labelname }`
1028-
template_paths []string // all the .html/.md files that were processed with $tmpl
1029-
unique_prefix string // a hash of the `.path` field, used for making anon fn generation unique
1014+
idx int // index in an external container; can be used to refer to the file in a more efficient way, just by its integer index
1015+
path string // absolute path of the source file - '/projects/v/file.v'
1016+
path_base string // file name - 'file.v' (useful for tracing)
1017+
scope &Scope = unsafe { nil }
1018+
stmts []Stmt // all the statements in the source file
1019+
imports []Import // all the imports
1020+
auto_imports []string // imports that were implicitly added
1021+
used_imports []string
1022+
implied_imports []string // ​imports that the user's code uses but omitted to import explicitly, used by `vfmt`
1023+
embedded_files []EmbeddedFile // list of files to embed in the binary
1024+
imported_symbols map[string]string // used for `import {symbol}`, it maps symbol => module.symbol
1025+
imported_symbols_used map[string]bool
1026+
errors []errors.Error // all the checker errors in the file
1027+
warnings []errors.Warning // all the checker warnings in the file
1028+
notices []errors.Notice // all the checker notices in the file
1029+
generic_fns []&FnDecl
1030+
global_labels []string // from `asm { .globl labelname }`
1031+
template_paths []string // all the .html/.md files that were processed with $tmpl
1032+
unique_prefix string // a hash of the `.path` field, used for making anon fn generation unique
10301033
//
10311034
is_parse_text bool // true for files, produced by parse_text
10321035
is_template_text bool // true for files, produced by parse_comptime

‎vlib/v/fmt/comments.v‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ pub fn (mut f Fmt) import_comments(comments []ast.Comment, options CommentsOptio
117117
return
118118
}
119119
if options.same_line {
120-
f.remove_new_line(imports_buffer: true)
120+
f.remove_new_line()
121121
}
122122
for c in comments {
123123
ctext := c.text.trim_left('\x01')
@@ -129,7 +129,7 @@ pub fn (mut f Fmt) import_comments(comments []ast.Comment, options CommentsOptio
129129
out_s += ' '
130130
}
131131
out_s += ctext
132-
f.out_imports.writeln(out_s)
132+
f.writeln(out_s)
133133
}
134134
}
135135

0 commit comments

Comments
 (0)