MCPcopy Create free account
hub / github.com/InfinitiBit/graphbit / parse_google_param_line

Function parse_google_param_line

python/src/workflow/node.rs:724–745  ·  view source on GitHub ↗

Parse a single parameter line from Google-style docstring

(line: &str)

Source from the content-addressed store, hash-verified

722
723/// Parse a single parameter line from Google-style docstring
724fn 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
748fn extract_parameters_section_numpy(docstring: &str) -> Option<String> {

Callers 1

Calls 2

to_stringMethod · 0.80
is_emptyMethod · 0.45

Tested by

no test coverage detected