mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
vdoc: plaintext fixes
This commit is contained in:
@@ -119,7 +119,6 @@ pub fn (mut a array) sort_with_compare(compare voidptr) {
|
||||
// In the current state only that would work:
|
||||
// i := 3
|
||||
// a.insert(0, &i)
|
||||
// ----------------------------
|
||||
pub fn (mut a array) insert(i int, val voidptr) {
|
||||
$if !no_bounds_checking? {
|
||||
if i < 0 || i > a.len {
|
||||
@@ -135,7 +134,6 @@ pub fn (mut a array) insert(i int, val voidptr) {
|
||||
|
||||
// TODO array.prepend is broken
|
||||
// It depends on array.insert
|
||||
// -----------------------------
|
||||
pub fn (mut a array) prepend(val voidptr) {
|
||||
a.insert(0, val)
|
||||
}
|
||||
|
||||
@@ -298,20 +298,23 @@ pub fn (mut d Doc) generate() ?bool {
|
||||
prev_comments << stmt
|
||||
continue
|
||||
}
|
||||
// TODO: Fetch head comment once
|
||||
if stmt is ast.Module {
|
||||
// the previous comments were probably a copyright/license one
|
||||
module_comment := get_comment_block_right_before(prev_comments)
|
||||
prev_comments = []
|
||||
if module_comment == '' {
|
||||
continue
|
||||
if 'vlib' !in base_path && !module_comment.starts_with('Copyright (c)') {
|
||||
if module_comment == '' {
|
||||
continue
|
||||
}
|
||||
if module_comment == d.head.comment {
|
||||
continue
|
||||
}
|
||||
if d.head.comment != '' {
|
||||
d.head.comment += '\n'
|
||||
}
|
||||
d.head.comment += module_comment
|
||||
}
|
||||
if module_comment == d.head.comment {
|
||||
continue
|
||||
}
|
||||
if d.head.comment != '' {
|
||||
d.head.comment += '\n'
|
||||
}
|
||||
d.head.comment += module_comment
|
||||
continue
|
||||
}
|
||||
if last_import_stmt_idx > 0 && sidx == last_import_stmt_idx {
|
||||
|
||||
Reference in New Issue
Block a user