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


Python BuiltinsGenerator.mangledNameForFunction方法代码示例

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


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

示例1: generate_externs_for_object

# 需要导入模块: from builtins_generator import BuiltinsGenerator [as 别名]
# 或者: from builtins_generator.BuiltinsGenerator import mangledNameForFunction [as 别名]
    def generate_externs_for_object(self, object):
        lines = []

        for function in object.functions:
            function_args = {
                'codeName': BuiltinsGenerator.mangledNameForFunction(function) + 'Code',
            }

            lines.append("""extern const char* s_%(codeName)s;
extern const int s_%(codeName)sLength;
extern const JSC::ConstructAbility s_%(codeName)sConstructAbility;""" % function_args)

        return lines
开发者ID:teamfx,项目名称:openjfx-8u-dev-rt,代码行数:15,代码来源:builtins_generate_combined_header.py

示例2: generate_section_for_code_table_macro

# 需要导入模块: from builtins_generator import BuiltinsGenerator [as 别名]
# 或者: from builtins_generator.BuiltinsGenerator import mangledNameForFunction [as 别名]
    def generate_section_for_code_table_macro(self):
        args = {
            'macroPrefix': self.model().framework.setting('macro_prefix'),
        }

        lines = []
        lines.append("#define %(macroPrefix)s_FOREACH_BUILTIN_CODE(macro) \\" % args)
        for function in self.model().all_functions():
            function_args = {
                'funcName': function.function_name,
                'codeName': BuiltinsGenerator.mangledNameForFunction(function) + 'Code',
            }

            lines.append("    macro(%(codeName)s, %(funcName)s, s_%(codeName)sLength) \\" % function_args)
        return '\n'.join(lines)
开发者ID:josecu,项目名称:webkit,代码行数:17,代码来源:builtins_generate_combined_header.py

示例3: generate_macros_for_object

# 需要导入模块: from builtins_generator import BuiltinsGenerator [as 别名]
# 或者: from builtins_generator.BuiltinsGenerator import mangledNameForFunction [as 别名]
    def generate_macros_for_object(self, object):
        args = {
            'macroPrefix': self.model().framework.setting('macro_prefix'),
            'objectMacro': object.object_name.replace('.', '').upper(),
        }

        lines = []
        lines.append("#define %(macroPrefix)s_FOREACH_%(objectMacro)s_BUILTIN_DATA(macro) \\" % args)
        for function in object.functions:
            function_args = {
                'funcName': function.function_name,
                'mangledName': BuiltinsGenerator.mangledNameForFunction(function),
                'paramCount': len(function.parameters),
            }

            lines.append("    macro(%(funcName)s, %(mangledName)s, %(paramCount)d) \\" % function_args)
        return lines
开发者ID:teamfx,项目名称:openjfx-8u-dev-rt,代码行数:19,代码来源:builtins_generate_combined_header.py

示例4: generate_section_for_global_private_code_name_macro

# 需要导入模块: from builtins_generator import BuiltinsGenerator [as 别名]
# 或者: from builtins_generator.BuiltinsGenerator import mangledNameForFunction [as 别名]
    def generate_section_for_global_private_code_name_macro(self):
        args = {
            'macroPrefix': self.model().framework.setting('macro_prefix'),
        }

        lines = []
        lines.append("#define %(macroPrefix)s_FOREACH_BUILTIN_FUNCTION_PRIVATE_GLOBAL_NAME(macro) \\" % args)
        functions = filter(lambda function: function.is_global_private, self.model().all_functions())
        functions.sort(key=lambda x: x.function_name)
        for function in functions:
            function_args = {
                'funcName': function.function_name,
                'codeName': BuiltinsGenerator.mangledNameForFunction(function),
            }

            lines.append("    macro(%(funcName)s, %(codeName)s) \\" % function_args)

        return '\n'.join(lines)
开发者ID:teamfx,项目名称:openjfx-8u-dev-rt,代码行数:20,代码来源:builtins_generate_combined_header.py


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