[CFWS] 1*attrtext [CFWS] This version of the BNF makes the CFWS explicit, and as usual we use a value terminal for the actual run of characters. The RFC equivalent of attrtext is the token characters, with the subtraction of '*', "'", and '%'. We include tab in the excluded set ju
(value)
| 2327 | return attrtext, value |
| 2328 | |
| 2329 | def get_attribute(value): |
| 2330 | """ [CFWS] 1*attrtext [CFWS] |
| 2331 | |
| 2332 | This version of the BNF makes the CFWS explicit, and as usual we use a |
| 2333 | value terminal for the actual run of characters. The RFC equivalent of |
| 2334 | attrtext is the token characters, with the subtraction of '*', "'", and '%'. |
| 2335 | We include tab in the excluded set just as we do for token. |
| 2336 | |
| 2337 | """ |
| 2338 | attribute = Attribute() |
| 2339 | if value and value[0] in CFWS_LEADER: |
| 2340 | token, value = get_cfws(value) |
| 2341 | attribute.append(token) |
| 2342 | if value and value[0] in ATTRIBUTE_ENDS: |
| 2343 | raise errors.HeaderParseError( |
| 2344 | "expected token but found '{}'".format(value)) |
| 2345 | token, value = get_attrtext(value) |
| 2346 | attribute.append(token) |
| 2347 | if value and value[0] in CFWS_LEADER: |
| 2348 | token, value = get_cfws(value) |
| 2349 | attribute.append(token) |
| 2350 | return attribute, value |
| 2351 | |
| 2352 | def get_extended_attrtext(value): |
| 2353 | """attrtext = 1*(any non-ATTRIBUTE_ENDS character plus '%') |
no test coverage detected