Skip to content

Commit

Permalink
Fix documentation recognition in parser
Browse files Browse the repository at this point in the history
  • Loading branch information
saona-raimundo committed Jan 11, 2022
1 parent 8f5fffd commit 5a02e37
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/parser/src/ast/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -514,13 +514,13 @@ impl Resolver {
}
let mut docs = String::new();
for doc in doc.docs.iter() {
// Comments which are not doc-comments are silently ignored
if let Some(doc) = doc.strip_prefix("///") {
docs.push_str(doc.trim_start_matches('/').trim());
docs.push('\n');
} else {
assert!(doc.starts_with("/**"));
} else if let Some(doc) = doc.strip_prefix("/**") {
assert!(doc.ends_with("*/"));
for line in doc[3..doc.len() - 2].lines() {
for line in doc[..doc.len() - 2].lines() {
docs.push_str(line);
docs.push('\n');
}
Expand Down

0 comments on commit 5a02e37

Please sign in to comment.