MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / read_and_preprocess

Function read_and_preprocess

tools/building.py:1339–1352  ·  view source on GitHub ↗
(filename, expand_macros=False)

Source from the content-addressed store, hash-verified

1337
1338
1339def read_and_preprocess(filename, expand_macros=False):
1340 # Create a settings file with the current settings to pass to the JS preprocessor
1341 settings_json = json.dumps(settings.external_dict(), sort_keys=True, indent=2)
1342 write_intermediate(settings_json, 'settings.json')
1343
1344 # Run the JS preprocessor
1345 dirname, filename = os.path.split(filename)
1346 if not dirname:
1347 dirname = None
1348 args = ['-', filename]
1349 if expand_macros:
1350 args += ['--expand-macros']
1351
1352 return shared.run_js_tool(path_from_root('tools/preprocessor.mjs'), args, input=settings_json, stdout=subprocess.PIPE, cwd=dirname)
1353
1354
1355def js_legalization_pass_flags():

Callers

nothing calls this directly

Calls 4

write_intermediateFunction · 0.85
path_from_rootFunction · 0.85
external_dictMethod · 0.80
splitMethod · 0.80

Tested by

no test coverage detected