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

vdoc: style and other improvements

This commit is contained in:
Daniel Däschle
2020-06-04 23:50:59 +02:00
committed by GitHub
parent 6118875ee3
commit d0f9bdf85e
10 changed files with 613 additions and 60 deletions

View File

@@ -144,7 +144,12 @@ pub fn (nodes []DocNode) find_children_of(parent_type string) []DocNode {
}
fn get_parent_mod(dir string) ?string {
if dir.len == 0 { return error('root folder reached') }
$if windows {
// windows root path is C: or D:
if dir.len <= 2 { return error('root folder reached') }
} $else {
if dir.len == 0 { return error('root folder reached') }
}
base_dir := os.base_dir(dir)
if os.file_name(base_dir) in ['encoding', 'v'] && 'vlib' in base_dir {
return os.file_name(base_dir)