import buildconfig import yaml from mozbuild.preprocessor import Preprocessor
HEADER_TEMPLATE = """\
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef %(includeguard)s #define %(includeguard)s
/* This file is generated by wasm/GenerateBuiltinModules.py. Do not edit! */
def load_yaml(yaml_path): # First invoke preprocessor.py so that we can use #ifdef JS_SIMULATOR in # the YAML file.
pp = Preprocessor()
pp.context.update(buildconfig.defines["ALLDEFINES"])
pp.out = io.StringIO()
pp.do_filter("substitution")
pp.do_include(yaml_path)
contents = pp.out.getvalue() return yaml.safe_load(contents)
def cppBool(v): if v: return"true" return"false"
def specTypeToMIRType(specType): if isinstance(specType, dict): return"MIRType::WasmAnyRef" if specType in {"i32", "i64", "f32", "f64"}: return f"ValType::{specType}().toMIRType()" if specType in {"externref", "anyref", "funcref", "contref", "exnref"}: return"MIRType::WasmAnyRef" raise ValueError()
def specHeapTypeToTypeCode(specHeapType): if specHeapType == "func": return"Func" if specHeapType == "any": return"Any" if specHeapType == "extern": return"Extern" if specHeapType == "exn": return"Exn" if specHeapType == "cont": return"Cont" if specHeapType == "array": return"Array" if specHeapType == "struct": return"Struct" raise ValueError()
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.