MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / _ParseContinue

Function _ParseContinue

extern/re2/re2/unicode.py:97–121  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

95
96
97def _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&#x27;
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
124def ReadUnicodeTable(filename, nfields, doline):

Callers 1

ReadUnicodeTableFunction · 0.85

Calls 1

matchMethod · 0.45

Tested by

no test coverage detected