Skip to content

Commit 615e74d

Browse files
committed
vlib: reduce false positive matches for /// , cleanup commented code
1 parent af62471 commit 615e74d

File tree

10 files changed

+12
-46
lines changed

10 files changed

+12
-46
lines changed

cmd/tools/modules/testing/output_normal.v

+2-2
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ pub fn (r NormalReporter) report_stop() {
113113
eprintln('')
114114
}
115115

116-
//// TODO: reconsider if these should be public:
117-
116+
// progress will show the given message normally
117+
// TODO: reconsider if these should be public:
118118
pub fn (r NormalReporter) progress(index int, message string) {
119119
eprintln(message)
120120
}

vlib/datatypes/bstree.v

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module datatypes
22

3-
/// Internal representation of the tree node
3+
// Internal representation of the tree node
44
@[heap]
55
struct BSTreeNode[T] {
66
mut:

vlib/dlmalloc/dlmalloc.v

+1-1
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,7 @@ pub fn (mut dl Dlmalloc) malloc(size usize) voidptr {
926926
}
927927
}
928928

929-
/// malloc behaves as libc malloc, but operates within the given space
929+
// malloc_real behaves as libc malloc, but operates within the given space
930930
@[unsafe]
931931
fn (mut dl Dlmalloc) malloc_real(size usize) voidptr {
932932
mut nb := usize(0)

vlib/dlmalloc/global.v

+3-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ module dlmalloc
33

44
__global global = new(get_system_allocator())
55

6-
/// malloc allocates `size` bytes.
7-
///
8-
/// Returns a null pointer if allocation fails. Returns a valid pointer
9-
/// otherwise.
6+
// malloc allocates `size` bytes.
7+
// It returns a null pointer if allocation fails.
8+
// It returns a valid pointer otherwise.
109
@[unsafe]
1110
pub fn malloc(size usize) voidptr {
1211
unsafe {

vlib/io/reader.v

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module io
22

3-
/// Eof error means that we reach the end of the stream.
3+
// Eof error means that we reach the end of the stream.
44
pub struct Eof {
55
Error
66
}

vlib/os/file.c.v

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module os
22

3-
/// Eof error means that we reach the end of the file.
3+
// Eof error means that we reach the end of the file.
44
pub struct Eof {
55
Error
66
}

vlib/v/checker/autocomplete.v

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ fn (mut c Checker) ident_autocomplete(node ast.Ident) {
4242
if !c.pref.linfo.vars_printed[nt] { // avoid dups
4343
sb.writeln('===')
4444
sb.writeln('VAR ${nt}') //${node.name}:${sym.name}')
45-
/// print_backtrace()
45+
// print_backtrace()
4646
/*
4747
if sym.kind == .alias {
4848
parent_sym := c.table.sym(sym.parent_type)

vlib/v/gen/c/fn.v

+1-1
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ fn (mut g Gen) fn_decl_params(params []ast.Param, scope &ast.Scope, is_variadic
754754
g.write('void')
755755
}
756756
}
757-
/// mut is_implicit_ctx := false
757+
// mut is_implicit_ctx := false
758758
// Veb actions defined by user can have implicit context
759759
/*
760760
if g.cur_fn != unsafe { nil } && g.cur_fn.is_method && g.cur_mod.name != 'veb' {

vlib/v/gen/native/macho.v

+1-1
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ pub fn (mut g Gen) generate_macho_object_header() {
317317
g.write32(0)
318318
g.write32(0)
319319
g.write32(0)
320-
/// ???
320+
// ???
321321
g.write32(0x32)
322322
g.write32(0x18)
323323
g.write32(0x01)

vlib/v/pref/line_info.v

-33
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22
// Use of this source code is governed by an MIT license that can be found in the LICENSE file.
33
module pref
44

5-
// import v.ast
6-
// import v.pref
7-
// import os
8-
9-
// fn (mut p Pref) parse_line_info(line string, all_ast_files []&ast.File) {
105
fn (mut p Preferences) parse_line_info(line string) {
116
// println("parse_line_info '${line}'")
127
format_err := 'wrong format, use `-line-info "file.v:24:expr_to_look_up"'
@@ -22,34 +17,6 @@ fn (mut p Preferences) parse_line_info(line string) {
2217
eprintln(format_err)
2318
return
2419
}
25-
26-
// println('files.len=${c.files.len}')
27-
// Find which file contains the line
28-
mut found := true // false
29-
//// mut found_path := ''
30-
// mut found_file_idx := -1
31-
/*
32-
for i, file in all_ast_files {
33-
// base := os.base(file.path)
34-
base := file.path // os.base(file.path)
35-
// println(base)
36-
if base == file_name {
37-
if found {
38-
eprintln('more than one "${file_name}" found: "${file.path}" and "${found_path}"')
39-
return
40-
}
41-
found = true
42-
found_path = file.path
43-
found_file_idx = i
44-
}
45-
}
46-
*/
47-
48-
if !found {
49-
eprintln('file "${file_name}" not found among those parsed')
50-
return
51-
}
52-
5320
p.linfo = LineInfo{
5421
line_nr: line_nr
5522
path: file_name

0 commit comments

Comments
 (0)