[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)
| 2370 | return attrtext, value |
| 2371 | |
| 2372 | def get_attribute(value): |
| 2373 | """ [CFWS] 1*attrtext [CFWS] |
| 2374 | |
| 2375 | This version of the BNF makes the CFWS explicit, and as usual we use a |
| 2376 | value terminal for the actual run of characters. The RFC equivalent of |
| 2377 | attrtext is the token characters, with the subtraction of '*', "'", and '%'. |
| 2378 | We include tab in the excluded set just as we do for token. |
| 2379 | |
| 2380 | """ |
| 2381 | attribute = Attribute() |
| 2382 | if value and value[0] in CFWS_LEADER: |
| 2383 | token, value = get_cfws(value) |
| 2384 | attribute.append(token) |
| 2385 | if value and value[0] in ATTRIBUTE_ENDS: |
| 2386 | raise errors.HeaderParseError( |
| 2387 | "expected token but found '{}'".format(value)) |
| 2388 | token, value = get_attrtext(value) |
| 2389 | attribute.append(token) |
| 2390 | if value and value[0] in CFWS_LEADER: |
| 2391 | token, value = get_cfws(value) |
| 2392 | attribute.append(token) |
| 2393 | return attribute, value |
| 2394 | |
| 2395 | def get_extended_attrtext(value): |
| 2396 | """attrtext = 1*(any non-ATTRIBUTE_ENDS character plus '%') |
no test coverage detected
searching dependent graphs…