コード例 #1
0
ファイル: CTypePyObjectPtrs.py プロジェクト: pmeerw/Nuitka
    def emitTruthCheckCode(cls, to_name, value_name, needs_check, emit,
                           context):
        emit("%s = CHECK_IF_TRUE( %s );" % (to_name, value_name))

        if needs_check:
            getErrorExitBoolCode(condition="%s == -1" % to_name,
                                 needs_check=needs_check,
                                 emit=emit,
                                 context=context)
コード例 #2
0
ファイル: CTypePyObjectPtrs.py プロジェクト: kayhayen/Nuitka
    def emitTruthCheckCode(cls, to_name, value_name, needs_check, emit, context):
        emit("%s = CHECK_IF_TRUE( %s );" % (to_name, value_name))

        if needs_check:
            getErrorExitBoolCode(
                condition="%s == -1" % to_name,
                needs_check=needs_check,
                emit=emit,
                context=context,
            )
コード例 #3
0
ファイル: CTypePyObjectPtrs.py プロジェクト: txf626/Nuitka
    def emitAssignmentCodeToNuitkaBool(cls, to_name, value_name, needs_check,
                                       emit, context):
        truth_name = context.allocateTempName("truth_name", "int")

        emit("%s = CHECK_IF_TRUE(%s);" % (truth_name, value_name))

        getErrorExitBoolCode(
            condition="%s == -1" % truth_name,
            needs_check=needs_check,
            emit=emit,
            context=context,
        )

        emit("%s = %s == 0 ? NUITKA_BOOL_FALSE : NUITKA_BOOL_TRUE;" %
             (to_name, truth_name))
コード例 #4
0
ファイル: CTypePyObjectPtrs.py プロジェクト: pmeerw/Nuitka
    def emitAssignmentCodeToNuitkaBool(cls, to_name, value_name, needs_check,
                                       emit, context):
        if needs_check:
            truth_name = context.allocateTempName("truth_name", "int")

            emit("%s = CHECK_IF_TRUE( %s );" % (truth_name, value_name))

            getErrorExitBoolCode(condition="%s == -1" % truth_name,
                                 emit=emit,
                                 context=context,
                                 needs_check=True)

            emit("%s = %s == 1 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;" %
                 (to_name, truth_name))
        else:
            cls.emitAssignmentCodeFromBoolCondition(to_name=to_name,
                                                    condition="%s == 1",
                                                    emit=emit)
コード例 #5
0
ファイル: CTypePyObjectPtrs.py プロジェクト: kayhayen/Nuitka
    def emitAssignmentCodeToNuitkaBool(
        cls, to_name, value_name, needs_check, emit, context
    ):
        truth_name = context.allocateTempName("truth_name", "int")

        emit("%s = CHECK_IF_TRUE( %s );" % (truth_name, value_name))

        getErrorExitBoolCode(
            condition="%s == -1" % truth_name,
            needs_check=needs_check,
            emit=emit,
            context=context,
        )

        emit(
            "%s = %s == 1 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;"
            % (to_name, truth_name)
        )