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

vdoc: fix panic on empty // comment on v doc -f html file.v; turn expected code block after empty example to a warning

This commit is contained in:
Delyan Angelov
2022-05-02 23:48:37 +03:00
parent cf92224248
commit 4da2908d63
6 changed files with 36 additions and 13 deletions

View File

@@ -62,13 +62,12 @@ pub fn (dc DocNode) merge_comments_without_examples() string {
if dc.comments[i].is_multi_line_example() {
i++
if i == dc.comments.len || !dc.comments[i].has_triple_backtick() {
eprintln('$dc.file_path:$dc.pos.line_nr: Expected code block after empty example line:')
eprintln('$dc.file_path:$dc.pos.line_nr: warning: expected code block after empty example line:')
eprintln('// ```')
if i < dc.comments.len {
eprintln('Found:')
eprintln('//' + dc.comments[i].text[1..])
}
exit(1)
}
i++
for i < dc.comments.len && !dc.comments[i].has_triple_backtick() {