MCPcopy Create free account
hub / github.com/917Dhj/DeepPaperNote / _split_inline_yaml_list

Function _split_inline_yaml_list

scripts/common.py:1216–1236  ·  view source on GitHub ↗
(value: str)

Source from the content-addressed store, hash-verified

1214
1215
1216def _split_inline_yaml_list(value: str) -> list[str]:
1217 items: list[str] = []
1218 current = []
1219 in_single = False
1220 in_double = False
1221 for char in value:
1222 if char == "'" and not in_double:
1223 in_single = not in_single
1224 elif char == '"' and not in_single:
1225 in_double = not in_double
1226 elif char == "," and not in_single and not in_double:
1227 item = _parse_yaml_scalar("".join(current))
1228 if item:
1229 items.append(item)
1230 current = []
1231 continue
1232 current.append(char)
1233 item = _parse_yaml_scalar("".join(current))
1234 if item:
1235 items.append(item)
1236 return items
1237
1238
1239def _parse_yaml_value(value: str) -> str | list[str]:

Callers 1

_parse_yaml_valueFunction · 0.85

Calls 1

_parse_yaml_scalarFunction · 0.85

Tested by

no test coverage detected