Parses a Unicode continuation field. These are of the form ' ' or ' '. Instead of giving an explicit range in a single table entry, some Unicode tables use two entries, one for the first code value in the range and one for the last. The first entry's description is
(s)
| 95 | |
| 96 | |
| 97 | def _ParseContinue(s): |
| 98 | """Parses a Unicode continuation field. |
| 99 | |
| 100 | These are of the form '<Name, First>' or '<Name, Last>'. |
| 101 | Instead of giving an explicit range in a single table entry, |
| 102 | some Unicode tables use two entries, one for the first |
| 103 | code value in the range and one for the last. |
| 104 | The first entry's description is '<Name, First>' instead of 'Name' |
| 105 | and the second is '<Name, Last>'. |
| 106 | |
| 107 | '<Name, First>' => ('Name', 'First') |
| 108 | '<Name, Last>' => ('Name', 'Last') |
| 109 | 'Anything else' => ('Anything else', None) |
| 110 | |
| 111 | Args: |
| 112 | s: continuation field string |
| 113 | |
| 114 | Returns: |
| 115 | pair: name and ('First', 'Last', or None) |
| 116 | """ |
| 117 | |
| 118 | match = re.match("<(.*), (First|Last)>", s) |
| 119 | if match is not None: |
| 120 | return match.groups() |
| 121 | return (s, None) |
| 122 | |
| 123 | |
| 124 | def ReadUnicodeTable(filename, nfields, doline): |
no test coverage detected