本文整理汇总了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
示例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)
示例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
示例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)