当前位置: 首页>>代码示例>>Python>>正文


Python BuiltinsGenerator.wrap_with_guard方法代码示例

本文整理汇总了Python中builtins_generator.BuiltinsGenerator.wrap_with_guard方法的典型用法代码示例。如果您正苦于以下问题:Python BuiltinsGenerator.wrap_with_guard方法的具体用法?Python BuiltinsGenerator.wrap_with_guard怎么用?Python BuiltinsGenerator.wrap_with_guard使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在builtins_generator.BuiltinsGenerator的用法示例。


在下文中一共展示了BuiltinsGenerator.wrap_with_guard方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: generate_members

# 需要导入模块: from builtins_generator import BuiltinsGenerator [as 别名]
# 或者: from builtins_generator.BuiltinsGenerator import wrap_with_guard [as 别名]
 def generate_members(self):
     guards = set([object.annotations.get('conditional') for object in self.internals if 'conditional' in object.annotations])
     lines = [BuiltinsGenerator.wrap_with_guard(" || ".join(guards), "    JSC::VM& m_vm;")]
     for object in self.internals:
         member = "    %s %s;" % (self.member_type(object), self.member_name(object))
         lines.append(BuiltinsGenerator.wrap_with_guard(object.annotations.get('conditional'), member))
     return '\n'.join(lines)
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:9,代码来源:builtins_generate_internals_wrapper_header.py

示例2: generate_constructor

# 需要导入模块: from builtins_generator import BuiltinsGenerator [as 别名]
# 或者: from builtins_generator.BuiltinsGenerator import wrap_with_guard [as 别名]
 def generate_constructor(self):
     guards = set([object.annotations.get('conditional') for object in self.internals if 'conditional' in object.annotations])
     lines = ["JSBuiltinInternalFunctions::JSBuiltinInternalFunctions(JSC::VM& vm)",
              BuiltinsGenerator.wrap_with_guard(" || ".join(guards), "    : m_vm(vm)")]
     for object in self.internals:
         initializer = "    , %s(m_vm)" % self.member_name(object)
         lines.append(BuiltinsGenerator.wrap_with_guard(object.annotations.get('conditional'), initializer))
     lines.append("{")
     lines.append("    UNUSED_PARAM(vm);")
     lines.append("}\n")
     return '\n'.join(lines)
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:13,代码来源:builtins_generate_internals_wrapper_implementation.py

示例3: generate_constructor

# 需要导入模块: from builtins_generator import BuiltinsGenerator [as 别名]
# 或者: from builtins_generator.BuiltinsGenerator import wrap_with_guard [as 别名]
 def generate_constructor(self):
     lines = ["    explicit JSBuiltinFunctions(JSC::VM& vm)",
              "        : m_vm(vm)"]
     for object in self.model().objects:
         member_init = "        , %s(&m_vm)" % self.member_name(object)
         lines.append(BuiltinsGenerator.wrap_with_guard(object.annotations.get('conditional'), member_init))
     lines.append("    {")
     for object in self.model().objects:
         if not 'internal' in object.annotations:
             continue
         internal_export_names = "        %s.exportNames();" % self.member_name(object)
         lines.append(BuiltinsGenerator.wrap_with_guard(object.annotations.get('conditional'), internal_export_names))
     lines.append("    }\n")
     return '\n'.join(lines)
开发者ID:mjparme,项目名称:openjdk-jfx,代码行数:16,代码来源:builtins_generate_wrapper_header.py

示例4: generate_initialize_method

# 需要导入模块: from builtins_generator import BuiltinsGenerator [as 别名]
# 或者: from builtins_generator.BuiltinsGenerator import wrap_with_guard [as 别名]
    def generate_initialize_method(self):
        lines = ["void JSBuiltinInternalFunctions::initialize(JSDOMGlobalObject& globalObject)",
                "{",
                "    UNUSED_PARAM(globalObject);"]

        for object in self.internals:
            init = "    %s.init(globalObject);" % self.member_name(object)
            lines.append(BuiltinsGenerator.wrap_with_guard(object.annotations.get('conditional'), init))
        lines.append("")

        guards = set([object.annotations.get('conditional') for object in self.internals if 'conditional' in object.annotations])
        lines.append(BuiltinsGenerator.wrap_with_guard(" || ".join(guards), self._generate_initialize_static_globals()))

        lines.append("}")
        return '\n'.join(lines)
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:17,代码来源:builtins_generate_internals_wrapper_implementation.py

示例5: generate_accessors

# 需要导入模块: from builtins_generator import BuiltinsGenerator [as 别名]
# 或者: from builtins_generator.BuiltinsGenerator import wrap_with_guard [as 别名]
 def generate_accessors(self):
     lines = []
     for object in self.internals:
         accessor = "    %s& %s() { return %s; }" % (self.member_type(object), self.accessor_name(object), self.member_name(object))
         lines.append(BuiltinsGenerator.wrap_with_guard(object.annotations.get('conditional'), accessor))
     lines.append("")
     return '\n'.join(lines)
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:9,代码来源:builtins_generate_internals_wrapper_header.py

示例6: _generate_initialize_static_globals

# 需要导入模块: from builtins_generator import BuiltinsGenerator [as 别名]
# 或者: from builtins_generator.BuiltinsGenerator import wrap_with_guard [as 别名]
 def _generate_initialize_static_globals(self):
     lines = ["    JSVMClientData& clientData = *static_cast<JSVMClientData*>(m_vm.clientData);",
              "    JSDOMGlobalObject::GlobalPropertyInfo staticGlobals[] = {"]
     for object in self.internals:
         lines.append(BuiltinsGenerator.wrap_with_guard(object.annotations.get('conditional'), self.property_macro(object)))
     lines.append("    };")
     lines.append("    globalObject.addStaticGlobals(staticGlobals, WTF_ARRAY_LENGTH(staticGlobals));")
     lines.append("    UNUSED_PARAM(clientData);")
     return '\n'.join(lines)
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:11,代码来源:builtins_generate_internals_wrapper_implementation.py

示例7: generate_visit_method

# 需要导入模块: from builtins_generator import BuiltinsGenerator [as 别名]
# 或者: from builtins_generator.BuiltinsGenerator import wrap_with_guard [as 别名]
 def generate_visit_method(self):
     lines = ["void JSBuiltinInternalFunctions::visit(JSC::SlotVisitor& visitor)",
              "{"]
     for object in self.internals:
         visit = "    %s.visit(visitor);" % self.member_name(object)
         lines.append(BuiltinsGenerator.wrap_with_guard(object.annotations.get('conditional'), visit))
     lines.append("    UNUSED_PARAM(visitor);")
     lines.append("}\n")
     return '\n'.join(lines)
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:11,代码来源:builtins_generate_internals_wrapper_implementation.py

示例8: generate_members

# 需要导入模块: from builtins_generator import BuiltinsGenerator [as 别名]
# 或者: from builtins_generator.BuiltinsGenerator import wrap_with_guard [as 别名]
 def generate_members(self):
     lines = ["    JSC::VM& m_vm;"]
     for object in self.model().objects:
         member = "    %s %s;" % (self.member_type(object), self.member_name(object))
         lines.append(BuiltinsGenerator.wrap_with_guard(object.annotations.get('conditional'), member))
     return '\n'.join(lines)
开发者ID:mjparme,项目名称:openjdk-jfx,代码行数:8,代码来源:builtins_generate_wrapper_header.py


注:本文中的builtins_generator.BuiltinsGenerator.wrap_with_guard方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。