Function
wrapped_c_string_literal
(
text: str,
*,
width: int = 72,
suffix: str = "",
initial_indent: int = 0,
subsequent_indent: int = 4
)
Source from the content-addressed store, hash-verified
| 91 | |
| 92 | |
| 93 | def wrapped_c_string_literal( |
| 94 | text: str, |
| 95 | *, |
| 96 | width: int = 72, |
| 97 | suffix: str = "", |
| 98 | initial_indent: int = 0, |
| 99 | subsequent_indent: int = 4 |
| 100 | ) -> str: |
| 101 | wrapped = textwrap.wrap( |
| 102 | text, |
| 103 | width=width, |
| 104 | replace_whitespace=False, |
| 105 | drop_whitespace=False, |
| 106 | break_on_hyphens=False, |
| 107 | ) |
| 108 | separator = '"' + suffix + "\n" + subsequent_indent * " " + '"' |
| 109 | return initial_indent * " " + '"' + separator.join(wrapped) + '"' |
| 110 | |
| 111 | |
| 112 | def _add_prefix_and_suffix(text: str, *, prefix: str = "", suffix: str = "") -> str: |
Callers
nothing calls this directly
Tested by
no test coverage detected
Used in the wild real call sites across dependent graphs
searching dependent graphs…