MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/MaterialX / _split_args

Method _split_args

python/Scripts/pybind_docs.py:423–454  ·  view source on GitHub ↗
(self, args_text: str)

Source from the content-addressed store, hash-verified

421 return -1
422
423 def _split_args(self, args_text: str) -> list:
424 args = []
425 current = []
426 depth = 0
427 in_string = False
428 escape = False
429 for c in args_text:
430 if escape:
431 current.append(c)
432 escape = False
433 continue
434 if c == '\\':
435 current.append(c)
436 escape = True
437 continue
438 if c == '"':
439 in_string = not in_string
440 current.append(c)
441 continue
442 if not in_string:
443 if c in '(<':
444 depth += 1
445 elif c in ')>':
446 depth -= 1
447 elif c == ',' and depth == 0:
448 args.append("".join(current).strip())
449 current = []
450 continue
451 current.append(c)
452 if current:
453 args.append("".join(current).strip())
454 return args
455
456 def _extract_class_name(self, args_text: str) -> Optional[str]:
457 args = self._split_args(args_text)

Callers 3

_insert_class_docsMethod · 0.95
_insert_method_docsMethod · 0.95
_extract_class_nameMethod · 0.95

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected