Commit Graph

1393 Commits

Author SHA1 Message Date
K. Lange
22e550ee67 Fixup bounds for negative values 2024-01-15 19:36:37 +09:00
K. Lange
049c58c40c Build strings from longs before formatting them 2024-01-15 19:27:08 +09:00
K. Lange
99dfc12a67 _ format specifier should be 3 digits for decimal, 4 for others 2024-01-15 19:25:51 +09:00
K. Lange
6e8aa9bee6 Don't pass around w as a KrkLong
We only shifting up to size_t bits anyway; expose the internal
size_t-based shifting, use that in these functions, and stop
allocating additional KrkLongs for the `w` values.

Since we only do this a few times and the values were very small,
this has minimal impact but does simplify the code a bit.
2024-01-13 16:57:07 +09:00
K. Lange
9590df3ef0 Faster binary-to-decimal conversions 2024-01-11 22:56:46 +09:00
K. Lange
b162ed889b Add support for building without nan-boxing 2024-01-11 13:36:27 +09:00
K. Lange
df4435efdc Ensure bytes are zero'd when building bytearrays 2024-01-10 21:56:23 +09:00
K. Lange
0b516fd7e2 Fix long.__rshift__ in particular to be linear
on the number of bits in the number to shift, not the amount
to shif it by
2024-01-10 13:48:08 +09:00
K. Lange
4008133a0b Fix bad value boxings 2024-01-08 17:09:24 +09:00
K. Lange
bc3024881f Fixes that should enable MSVC to build the core interpreter 2024-01-08 14:12:24 +09:00
K. Lange
c530cf20fd file names passed to krk_interpret, krk_compile, krk_runfile can be const 2024-01-08 10:53:38 +09:00
K. Lange
0a9a3c7129 Step one of trying to clean up the macro namespace 2024-01-08 09:29:52 +09:00
K. Lange
a5f5c30157 NONE_VAL and NOTIMPL_VAL don't actually take an argument 2024-01-08 09:09:29 +09:00
K. Lange
29b2f91762 Don't include sys/time.h, unused 2024-01-08 08:34:05 +09:00
K. Lange
6211f81535 Avoid passing -g to can-floor-without-libm as clang doesn't like -g with -o /dev/null 2024-01-07 21:27:54 +09:00
K. Lange
eb0d40a2ad shut clang up 2024-01-07 21:17:18 +09:00
K. Lange
e4136437c6 Add a test for expression underlining data 2024-01-07 17:51:50 +09:00
K. Lange
0c552807ff Simplify repl acquisition of build version 2024-01-07 17:40:19 +09:00
K. Lange
5bf7cf89c3 Optimize type.__call__ when __new__ is a native function 2024-01-07 15:16:53 +09:00
K. Lange
2f72a8004a Handle common case for int.__new__ better 2024-01-07 15:16:26 +09:00
K. Lange
484f0f68a1 Use krk_int_from_float for float.__int__, shortcircuit small enough values 2024-01-07 10:10:51 +09:00
K. Lange
114b66dd5c Set __hash__ to None when clearing it, to match CPython 2024-01-07 10:05:16 +09:00
K. Lange
efca612a20 Support Ellipsis in tools/compile.c 2024-01-03 14:34:17 +09:00
K. Lange
ae6ec7f233 Implement Ellipsis (...) 2024-01-01 19:36:55 +09:00
K. Lange
7f397b2c2c object.__str__ should call repr; remove extraneous __str__/__repr__ aliases 2024-01-01 19:31:54 +09:00
K. Lange
98bd980c2a Try to reduce size of debug functions by building them with -Os 2023-12-31 18:52:18 +09:00
K. Lange
a7c2f52814 Should be able to compile with just KRK_DISABLE_DEBUG without issues 2023-12-31 18:51:27 +09:00
K. Lange
a386ab7df0 Remove the long-deprecated KRK_FUNC, KRK_METHOD macros 2023-12-31 16:25:52 +09:00
K. Lange
886da1a134 Remove krk_printValue, move krk_printValueSafe to debug.c 2023-12-31 16:25:00 +09:00
K. Lange
07898d31b9 Expose expression span functionality in dis module 2023-12-31 09:46:20 +09:00
K. Lange
f3191a6067 Underline expressions in exception tracebacks.
Implements Python's PEP 657 by adding debug information
to map opcodes to their source expressions.
2023-12-31 09:46:20 +09:00
K. Lange
0c52d44d3e names array is not NULL-terminated; use 'oarg' which should be count of names at this point 2023-12-30 11:45:23 +09:00
K. Lange
c7caf52f3e Use parseArgs in dis module 2023-12-28 22:29:30 +09:00
K. Lange
643313baa0 Fix dropped references to keyword arguments in parseArgs 2023-12-28 22:04:48 +09:00
K. Lange
ebe1815075 Don't bother getting the alternate function name if we aren't raising an exception 2023-12-28 19:25:56 +09:00
K. Lange
e9b0269c91 Avoid creating strings for argument names unless necessary 2023-12-28 19:11:22 +09:00
K. Lange
d1bac84663 Cleanup headers 2023-12-28 10:20:42 +09:00
K. Lange
7023e2e1fe We've made so many incompatible changes this should be 1.5 now 2023-12-24 09:12:29 +09:00
K. Lange
4ac444be47 Generate more docs 2023-12-24 09:09:38 +09:00
K. Lange
9633ee3f72 New suite of time functions 2023-12-24 09:09:24 +09:00
K. Lange
3a74ef5e21 Add 'quiet' option, get_recursion_depth 2023-12-24 09:09:07 +09:00
K. Lange
416ed28206 Make maximumCallDepth thread-local, expose changing it when feasible 2023-12-24 09:05:52 +09:00
K. Lange
80754593ad Add pairing heap module 2023-12-22 08:26:57 +09:00
K. Lange
2685f49d24 Remove modules from import table if they raised exceptions on import 2023-12-21 10:50:08 +09:00
K. Lange
fe430bbb19 Provide a simpler interface for setting up modules that sets __name__ 2023-12-21 10:28:44 +09:00
K. Lange
6ea43c35e0 Include argument name in parseArgs type errors 2023-12-15 17:24:19 +09:00
K. Lange
031ca32ab0 extract fileio to a C module 2023-12-14 20:51:59 +09:00
K. Lange
c4d8e8de6b Accept file, flush in print 2023-12-14 20:45:10 +09:00
K. Lange
02c6f58f3c Separate 'gc' into shared module 2023-12-14 13:47:23 +09:00
K. Lange
874882d926 docs: stop calling everything the base class of all objects just because it doesn't have its own __doc__ 2023-12-14 12:30:55 +09:00