Parse optional whitespace from ``header`` at the given position. Return the new position. The whitespace itself isn't returned because it isn't significant.
(header: str, pos: int)
| 86 | |
| 87 | |
| 88 | def parse_OWS(header: str, pos: int) -> int: |
| 89 | """ |
| 90 | Parse optional whitespace from ``header`` at the given position. |
| 91 | |
| 92 | Return the new position. |
| 93 | |
| 94 | The whitespace itself isn't returned because it isn't significant. |
| 95 | |
| 96 | """ |
| 97 | # There's always a match, possibly empty, whose content doesn't matter. |
| 98 | match = _OWS_re.match(header, pos) |
| 99 | assert match is not None |
| 100 | return match.end() |
| 101 | |
| 102 | |
| 103 | _token_re = re.compile(r"[-!#$%&\'*+.^_`|~0-9a-zA-Z]+") |
no outgoing calls
no test coverage detected
searching dependent graphs…