MCPcopy
hub / github.com/antlr/antlr4 / main

Function main

scripts/parse-extended-pictographic/parse.py:6–17  ·  view source on GitHub ↗
(input, output)

Source from the content-addressed store, hash-verified

4import sys
5
6def main(input, output):
7 code_point_re = re.compile(r'^U\+([0-9a-fA-F]+)\s*;\s*ExtendedPictographic.*$')
8 code_point_range_re = re.compile(r'^U\+([0-9a-fA-F]+)\.\.U\+([0-9a-fA-F]+)\s*;\s*ExtendedPictographic.*$')
9
10 for line in input:
11 m = code_point_re.match(line)
12 if m:
13 print('set.add(0x' + m.group(1) + ');', file=output)
14 else:
15 m = code_point_range_re.match(line)
16 if m:
17 print('set.add(0x' + m.group(1) + ', 0x' + m.group(2) + ');', file=output)
18
19if __name__ == '__main__':
20 with codecs.open(sys.argv[1], 'r', 'utf-8') as f:

Callers 1

parse.pyFile · 0.70

Calls 2

compileMethod · 0.45
matchMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…