Skip to content

Commit

Permalink
Exclude global procs from parent var/proc linking
Browse files Browse the repository at this point in the history
Fixes #268.
  • Loading branch information
SpaceManiac committed May 28, 2021
1 parent 64e7ffd commit 4beb1f3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/dmdoc/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -500,15 +500,15 @@ fn main2() -> Result<(), Box<dyn std::error::Error>> {
if !var.value.docs.is_empty() {
// determine if there is a documented parent we can link to
let mut parent = None;
let mut next = ty.parent_type();
let mut next = ty.parent_type_without_root();
while let Some(current) = next {
if let Some(entry) = current.vars.get(name) {
if !entry.value.docs.is_empty() {
parent = Some(current.path[1..].to_owned());
break;
}
}
next = current.parent_type();
next = current.parent_type_without_root();
}

error_entity_put(format!("{}/var/{}", ty.path, name));
Expand Down Expand Up @@ -556,15 +556,15 @@ fn main2() -> Result<(), Box<dyn std::error::Error>> {
if !proc_value.docs.is_empty() {
// determine if there is a documented parent we can link to
let mut parent = None;
let mut next = ty.parent_type();
let mut next = ty.parent_type_without_root();
while let Some(current) = next {
if let Some(entry) = current.procs.get(name) {
if !entry.main_value().docs.is_empty() {
parent = Some(current.path[1..].to_owned());
break;
}
}
next = current.parent_type();
next = current.parent_type_without_root();
}

error_entity_put(format!("{}/proc/{}", ty.path, name));
Expand Down

0 comments on commit 4beb1f3

Please sign in to comment.