Parse a single parameter line from Google-style docstring
(line: &str)
| 722 | |
| 723 | /// Parse a single parameter line from Google-style docstring |
| 724 | fn parse_google_param_line(line: &str) -> Option<(String, String)> { |
| 725 | let trimmed = line.trim(); |
| 726 | |
| 727 | // Look for pattern: "param_name (type): description" or "param_name: description" |
| 728 | if let Some(colon_pos) = trimmed.find(':') { |
| 729 | let param_part = trimmed[..colon_pos].trim(); |
| 730 | let description = trimmed[colon_pos + 1..].trim(); |
| 731 | |
| 732 | // Extract parameter name (remove type annotation if present) |
| 733 | let param_name = if let Some(paren_pos) = param_part.find('(') { |
| 734 | param_part[..paren_pos].trim() |
| 735 | } else { |
| 736 | param_part |
| 737 | }; |
| 738 | |
| 739 | if !param_name.is_empty() && !description.is_empty() { |
| 740 | return Some((param_name.to_string(), description.to_string())); |
| 741 | } |
| 742 | } |
| 743 | |
| 744 | None |
| 745 | } |
| 746 | |
| 747 | /// Extract Parameters section from NumPy/Sphinx-style docstring |
| 748 | fn extract_parameters_section_numpy(docstring: &str) -> Option<String> { |
no test coverage detected