MCPcopy Create free account
hub / github.com/WebAssembly/wabt / ProcessFile

Function ProcessFile

scripts/gen-emscripten-exported-json.py:52–75  ·  view source on GitHub ↗
(nm, file_)

Source from the content-addressed store, hash-verified

50
51
52def ProcessFile(nm, file_):
53 names = []
54 for line in nm.RunWithArgsForStdout(file_).splitlines():
55 line = line.rstrip()
56 if not line.lstrip():
57 continue
58 if line.endswith(':'):
59 # displaying the archive name, e.g. "foo.c.o:"
60 continue
61 # line looks like:
62 #
63 # -------- d yycheck
64 # -------- t wabt_strndup_
65 # U wabt_parse_int64
66 # -------- T wabt_offsetof_allocator_alloc
67 #
68 # we want to only keep the "T" names; the extern function symbols defined
69 # in the object.
70 type_ = line[9]
71 if type_ != 'T':
72 continue
73 name = line[11:]
74 names.append('_' + name)
75 return names
76
77
78def main(args):

Callers 1

mainFunction · 0.85

Calls 2

RunWithArgsForStdoutMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected