Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Include/internal/pycore_unicodeobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,20 @@ extern PyObject* _PyUnicode_XStrip(
);


/* Search the longest common leading whitespace of all lines in [src, end).
Returns the length of the common leading whitespace and sets `*output` to
point to the beginning of the common leading whitespace if length > 0.
Declared with PyAPI_FUNC (not plain `extern`) so that the symbol is
reliably exported from the interpreter. Parser/string_parser.c calls it and
is also compiled into the standalone extension built by
test_peg_generator.test_c_parser, which resolves this symbol from the
running interpreter at load time. */
PyAPI_FUNC(Py_ssize_t) _Py_search_longest_common_leading_whitespace(
const char *src,
const char *end,
const char **output);

/* Dedent a string.
Intended to dedent Python source. Unlike `textwrap.dedent`, this
only supports spaces and tabs and doesn't normalize empty lines.
Expand Down
Loading
Loading