File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/complex Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 61
61
import static com .oracle .graal .python .nodes .SpecialMethodNames .__STR__ ;
62
62
import static com .oracle .graal .python .nodes .SpecialMethodNames .__SUB__ ;
63
63
import static com .oracle .graal .python .nodes .SpecialMethodNames .__TRUEDIV__ ;
64
+ import static com .oracle .graal .python .nodes .SpecialMethodNames .__DIVMOD__ ;
64
65
65
66
import java .util .List ;
66
67
76
77
import com .oracle .graal .python .nodes .function .builtins .PythonBinaryBuiltinNode ;
77
78
import com .oracle .graal .python .nodes .function .builtins .PythonUnaryBuiltinNode ;
78
79
import com .oracle .graal .python .nodes .truffle .PythonArithmeticTypes ;
80
+ import com .oracle .graal .python .runtime .exception .PythonErrorType ;
79
81
import com .oracle .truffle .api .CompilerDirectives .TruffleBoundary ;
80
82
import com .oracle .truffle .api .dsl .Fallback ;
81
83
import com .oracle .truffle .api .dsl .GenerateNodeFactory ;
@@ -306,6 +308,16 @@ PNotImplemented doComplex(Object left, Object right) {
306
308
}
307
309
}
308
310
311
+ @ GenerateNodeFactory
312
+ @ Builtin (name = __DIVMOD__ , fixedNumOfPositionalArgs = 2 )
313
+ static abstract class DivModNode extends PythonBinaryBuiltinNode {
314
+
315
+ @ Specialization
316
+ PComplex doComplexDouble (Object right , Object left ) {
317
+ throw raise (PythonErrorType .TypeError , "can't take floor or mod of complex number." );
318
+ }
319
+ }
320
+
309
321
@ GenerateNodeFactory
310
322
@ Builtin (name = __MUL__ , fixedNumOfPositionalArgs = 2 )
311
323
@ TypeSystemReference (PythonArithmeticTypes .class )
You can’t perform that action at this time.
0 commit comments