How to use the nuitka.codegen.ErrorCodes.getErrorExitCode function in Nuitka

To help you get started, we’ve selected a few Nuitka examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Nuitka / Nuitka / nuitka / codegen / DictCodes.py View on Github external
_getDictionaryCreationCode(
                    to_name=dict_name,
                    pairs=expression.getNamedArgumentPairs(),
                    emit=emit,
                    context=context,
                )
        else:
            dict_name = None

        if seq_name is not None:
            emit(
                "%s = TO_DICT( %s, %s );"
                % (value_name, seq_name, "NULL" if dict_name is None else dict_name)
            )

            getErrorExitCode(
                check_name=value_name,
                release_names=(seq_name, dict_name),
                emit=emit,
                context=context,
            )

            context.addCleanupTempName(value_name)
github Nuitka / Nuitka / nuitka / codegen / CallCodes.py View on Github external
def getCallCodeNoArgs(to_name, called_name, needs_check, emit, context):
    emitLineNumberUpdateCode(emit, context)

    emit("%s = CALL_FUNCTION_NO_ARGS( %s );" % (to_name, called_name))

    getErrorExitCode(
        check_name=to_name,
        release_name=called_name,
        emit=emit,
        needs_check=needs_check,
        context=context,
    )

    context.addCleanupTempName(to_name)
github Nuitka / Nuitka / nuitka / codegen / CallCodes.py View on Github external
def _getInstanceCallCodePosArgs(
    to_name, called_name, called_attribute_name, args_name, needs_check, emit, context
):
    emitLineNumberUpdateCode(emit, context)

    emit(
        "%s = CALL_METHOD_WITH_POSARGS( %s, %s, %s );"
        % (to_name, called_name, called_attribute_name, args_name)
    )

    getErrorExitCode(
        check_name=to_name,
        release_names=(called_name, args_name),
        needs_check=needs_check,
        emit=emit,
        context=context,
    )

    context.addCleanupTempName(to_name)
github Nuitka / Nuitka / nuitka / codegen / Generator.py View on Github external
def getBuiltinRefCode(to_name, builtin_name, emit, context):
    emit(
        "%s = LOOKUP_BUILTIN( %s );" % (
            to_name,
            getConstantCode(
                constant = builtin_name,
                context  = context
            )
        )
    )

    getErrorExitCode(
        check_name = to_name,
        emit       = emit,
        context    = context
    )
github Nuitka / Nuitka / nuitka / codegen / SliceCodes.py View on Github external
def _getSliceLookupIndexesCode(
    to_name, lower_name, upper_name, source_name, emit, context
):
    emit(
        "%s = LOOKUP_INDEX_SLICE(%s, %s, %s);"
        % (to_name, source_name, lower_name, upper_name)
    )

    getErrorExitCode(
        check_name=to_name, release_name=source_name, emit=emit, context=context
    )

    context.addCleanupTempName(to_name)
github Nuitka / Nuitka / nuitka / codegen / AttributeCodes.py View on Github external
def getAttributeLookupSpecialCode(
    to_name, source_name, attr_name, needs_check, emit, context
):
    emit("%s = LOOKUP_SPECIAL(%s, %s);" % (to_name, source_name, attr_name))

    getErrorExitCode(
        check_name=to_name,
        release_names=(source_name, attr_name),
        emit=emit,
        needs_check=needs_check,
        context=context,
    )

    context.addCleanupTempName(to_name)
github Nuitka / Nuitka / nuitka / codegen / EvalCodes.py View on Github external
source_name=source_name,
        filename_name=filename_name,
        mode_name=mode_name,
        flags_name="NULL",
        dont_inherit_name="NULL",
        optimize_name="NULL",
        emit=emit,
        context=context,
    )

    emit(
        "%s = EVAL_CODE( %s, %s, %s );"
        % (to_name, compiled_name, globals_name, locals_name)
    )

    getErrorExitCode(
        check_name=to_name,
        release_names=(compiled_name, globals_name, locals_name),
        emit=emit,
        context=context,
    )

    context.addCleanupTempName(to_name)
github Nuitka / Nuitka / nuitka / codegen / OperationCodes.py View on Github external
else:
        with withObjectCodeTemporaryAssignment(
            to_name, "op_%s_res" % operator.lower(), expression, emit, context
        ) as value_name:

            emit(
                "%s = %s( %s );"
                % (
                    value_name,
                    helper,
                    ", ".join(str(arg_name) for arg_name in prefix_args + arg_names),
                )
            )

            getErrorExitCode(
                check_name=value_name,
                release_names=arg_names,
                needs_check=needs_check,
                emit=emit,
                context=context,
            )

            if ref_count:
                context.addCleanupTempName(value_name)
github Nuitka / Nuitka / nuitka / codegen / FunctionCodes.py View on Github external
emit(
            "%s = %s( NULL%s%s );"
            % (
                to_name,
                function_identifier,
                ", " if suffix_args else "",
                ", ".join(str(arg) for arg in suffix_args),
            )
        )

    # Arguments are owned to the called in direct function call.
    for arg_name in arg_names:
        if context.needsCleanup(arg_name):
            context.removeCleanupTempName(arg_name)

    getErrorExitCode(
        check_name=to_name, emit=emit, needs_check=needs_check, context=context
    )

    context.addCleanupTempName(to_name)
github Nuitka / Nuitka / nuitka / codegen / Generator.py View on Github external
def getBuiltinInt2Code(to_name, base_name, value_name, emit, context):
    emit(
        "%s = TO_INT2( %s, %s );" % (
            to_name,
            value_name,
            base_name
        )
    )

    getReleaseCodes(
        release_names = (value_name, base_name),
        emit          = emit,
        context       = context
    )

    getErrorExitCode(
        check_name = to_name,
        emit       = emit,
        context    = context
    )

    context.addCleanupTempName(to_name)