mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
tools: add support for new attribute syntax to missdoc
This commit is contained in:
parent
72718c2a62
commit
a15c067189
1 changed files with 3 additions and 2 deletions
|
@ -65,9 +65,10 @@ fn (opt &Options) collect_undocumented_functions_in_file(nfile string) []Undocum
|
|||
mut comments := []string{}
|
||||
mut tags := []string{}
|
||||
for i, line in lines {
|
||||
line_trimmed := line.trim_space()
|
||||
if line.starts_with('//') {
|
||||
comments << line
|
||||
} else if line.trim_space().starts_with('[') {
|
||||
} else if line_trimmed.starts_with('@[') || line_trimmed.starts_with('[') {
|
||||
tags << collect_tags(line)
|
||||
} else if line.starts_with('pub fn')
|
||||
|| (opt.private && (line.starts_with('fn ') && !(line.starts_with('fn C.')
|
||||
|
@ -213,7 +214,7 @@ fn collect(path string, mut l []string, f fn (string, mut []string)) {
|
|||
|
||||
fn collect_tags(line string) []string {
|
||||
mut cleaned := line.all_before('/')
|
||||
cleaned = cleaned.replace_each(['[', '', ']', '', ' ', ''])
|
||||
cleaned = cleaned.replace_each(['@[', '', '[', '', ']', '', ' ', ''])
|
||||
return cleaned.split(',')
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue