(
function_body,
function_identifier,
closure_variables,
defaults_name,
kw_defaults_name,
annotations_name,
function_doc,
type_params_name,
context,
)
| 131 | |
| 132 | |
| 133 | def getFunctionMakerCode( |
| 134 | function_body, |
| 135 | function_identifier, |
| 136 | closure_variables, |
| 137 | defaults_name, |
| 138 | kw_defaults_name, |
| 139 | annotations_name, |
| 140 | function_doc, |
| 141 | type_params_name, |
| 142 | context, |
| 143 | ): |
| 144 | # We really need this many parameters here and functions have many details, |
| 145 | # that we express as variables, pylint: disable=too-many-locals |
| 146 | function_creation_args = getFunctionCreationArgs( |
| 147 | defaults_name=defaults_name, |
| 148 | kw_defaults_name=kw_defaults_name, |
| 149 | annotations_name=annotations_name, |
| 150 | closure_variables=closure_variables, |
| 151 | type_params_name=type_params_name, |
| 152 | ) |
| 153 | |
| 154 | if function_doc is None: |
| 155 | function_doc = "NULL" |
| 156 | else: |
| 157 | function_doc = context.getConstantCode(constant=function_doc) |
| 158 | |
| 159 | ( |
| 160 | is_constant_returning, |
| 161 | constant_return_value, |
| 162 | ) = function_body.getConstantReturnValue() |
| 163 | |
| 164 | if is_constant_returning: |
| 165 | function_impl_identifier = "NULL" |
| 166 | |
| 167 | if constant_return_value is None: |
| 168 | # Default value, spare the code for common case. |
| 169 | constant_return_code = "" |
| 170 | elif constant_return_value is True: |
| 171 | constant_return_code = "Nuitka_Function_EnableConstReturnTrue(result);" |
| 172 | elif constant_return_value is False: |
| 173 | constant_return_code = "Nuitka_Function_EnableConstReturnFalse(result);" |
| 174 | else: |
| 175 | constant_return_code = ( |
| 176 | "Nuitka_Function_EnableConstReturnGeneric(result, %s);" |
| 177 | % context.getConstantCode(constant_return_value) |
| 178 | ) |
| 179 | else: |
| 180 | function_impl_identifier = _getFunctionEntryPointIdentifier( |
| 181 | function_identifier=function_identifier |
| 182 | ) |
| 183 | constant_return_code = "" |
| 184 | |
| 185 | function_maker_identifier = _getFunctionMakerIdentifier( |
| 186 | function_identifier=function_identifier |
| 187 | ) |
| 188 | |
| 189 | module_identifier = getModuleAccessCode(context=context) |
| 190 |
no test coverage detected
searching dependent graphs…