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

Function parse_s_args

tools/cmdline.py:172–194  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

170
171
172def parse_s_args():
173 for arg in options.s_args:
174 assert arg.startswith('-s')
175 arg = arg.removeprefix('-s')
176 # If not = is specified default to 1
177 if '=' in arg:
178 key, value = arg.split('=', 1)
179 else:
180 key = arg
181 value = '1'
182
183 # Special handling of browser version targets. A version -1 means that the specific version
184 # is not supported at all. Replace those with INT32_MAX to make it possible to compare e.g.
185 # #if MIN_FIREFOX_VERSION < 68
186 if re.match(r'MIN_.*_VERSION', key):
187 try:
188 if int(value) < 0:
189 value = '0x7FFFFFFF'
190 except Exception:
191 pass
192
193 key, value = normalize_boolean_setting(key, value)
194 user_settings[key] = value
195
196
197def parse_args(newargs): # noqa: C901, PLR0912, PLR0915

Callers 1

parse_argumentsFunction · 0.85

Calls 3

splitMethod · 0.80
matchMethod · 0.45

Tested by

no test coverage detected