173 Commits

Author SHA1 Message Date
K. Lange
97922d3922 Improvements to exceptions
- Exceptions get repr'd to print for better flexibility and no more weird
  if/else tree in dumpTraceback to handle other cases.
- Parser / compiler errors are now SyntaxError's.
- Try to read filenames when printing tracebacks.
- Fixup formatting to look more like CPython.
2021-01-17 18:19:00 +09:00
K. Lange
7e11fcb920 Try to help the compiler with branch prediction hints 2021-01-16 22:47:52 +09:00
K. Lange
66e52a90c3 Support more unpackables 2021-01-15 11:03:18 +09:00
K. Lange
5568665ad6 Unverified implementation for __getattr__ 2021-01-14 23:16:13 +09:00
K. Lange
6f51f7b841 Fix up error type for bad unpack 2021-01-14 21:38:06 +09:00
K. Lange
13bbc3ae2d Change 'let' semantics to do unpacking; support unpacking more things 2021-01-14 21:16:48 +09:00
K. Lange
d2d1c98a1e Add 'del' statement. 2021-01-14 16:08:25 +09:00
K. Lange
976db6f954 Integer type behind macros 2021-01-14 09:15:44 +09:00
K. Lange
9015176bbb Cleanups clang asked for 2021-01-14 09:15:18 +09:00
K. Lange
2b02ef457e Add basic support for -m argument to interpreter 2021-01-13 09:08:11 +09:00
K Lange
70732eed56 Add hex() 2021-01-12 22:57:39 +09:00
K. Lange
975d4dcb9b Implement __eq__ and hashing for tuples 2021-01-12 22:30:06 +09:00
K. Lange
058a510149 Add some missing builtins 2021-01-12 20:44:40 +09:00
K Lange
1f189ed82c Fixup string iteration for unicode strings 2021-01-12 20:11:52 +09:00
K. Lange
10f3c16e40 Major overhaul of strings to support Unicode 2021-01-12 19:23:14 +09:00
K. Lange
76b0b50154 don't explode on bad repr print? 2021-01-12 14:07:16 +09:00
K. Lange
d5645b3fb6 Fixup more GC losses 2021-01-12 07:34:26 +09:00
K. Lange
574dd82b92 fixup gc reserve ordering in tryBind 2021-01-11 21:52:44 +09:00
K. Lange
dc56d7b2ea Normalize __add__ for strings, but keep the shortcut around 2021-01-11 21:46:24 +09:00
K. Lange
b00fcc0c0a Call override functions for various operators if available 2021-01-11 17:48:32 +09:00
K. Lange
eb27158173 Class fields and access to class member methods 2021-01-11 16:31:34 +09:00
K. Lange
3141678fa0 Add 'is'/'is not' for exact object equivalence 2021-01-11 15:03:05 +09:00
K. Lange
1e6507e741 zero checks (without relying on FPE interrupt) 2021-01-11 14:50:01 +09:00
K. Lange
991ed99e78 Add a basic collections module 2021-01-11 14:08:05 +09:00
K. Lange
213c496372 Fix up string escapes, make sure we're handling nil bytes when printing 2021-01-11 11:41:26 +09:00
K. Lange
ff7dcbb92a Support 'return' from within a 'with' block 2021-01-10 23:39:05 +09:00
K. Lange
be0e8dd6c6 Add gc.collect() 2021-01-10 21:14:15 +09:00
K. Lange
b43c723be6 Should pop last by default; support negative indexes to count from back 2021-01-10 20:54:38 +09:00
K. Lange
78c5503341 list.pop() is really useful 2021-01-10 20:49:01 +09:00
K. Lange
fee817c3b7 Cleanup internal dict, list references 2021-01-10 19:44:02 +09:00
K. Lange
35570e7ee9 Support complex argument expansion in C functions 2021-01-10 18:49:52 +09:00
K. Lange
3532f24c75 Rewrite complex argument processor because that old stack-juggling version was awful 2021-01-10 18:23:28 +09:00
K. Lange
5ddb1b60bf Don't pointless call bindMethod in the VM; use direct references 2021-01-10 12:54:40 +09:00
K. Lange
98fea9bb64 print() should __str__, not __repr__; repl should __repr__, not printValue...
printValue() probably shouldn't exist... and that's about it.
2021-01-10 12:42:24 +09:00
K. Lange
500e761a67 krk_reserve_stack shouldn't be inline 2021-01-10 10:42:52 +09:00
K. Lange
997e1a8d2a length should determine truthiness where relevent 2021-01-09 13:58:46 +09:00
K. Lange
656942f612 Cleanup and useful builtins 2021-01-09 10:12:50 +09:00
K. Lange
c405bc1bfa Reserve stack space before directly passing stack to krk_dict_of in callValue 2021-01-08 22:18:04 +09:00
K Lange
2bd0d93596 Add kuroko.argv 2021-01-08 19:05:11 +09:00
K. Lange
fc05327c42 Support unpacking tuples in for ... in ... loops. 2021-01-08 17:42:57 +09:00
K. Lange
3735b9c16b Raise KeyboardInterrupt on ^C 2021-01-08 16:40:43 +09:00
K. Lange
0a9276863c Move module_paths to 'kuroko' insted of __builtins__ 2021-01-08 15:59:43 +09:00
K. Lange
596b552219 Add str.[l,r]strip() suite 2021-01-08 15:53:39 +09:00
K. Lange
0658d2f4dd Flags and Makefile for static building 2021-01-08 10:59:03 +09:00
K. Lange
ee518f9643 Fix two symbols missing namespacing prefixes 2021-01-08 06:49:27 +09:00
K Lange
44f69a78c2 Fix leak in _string_split 2021-01-07 23:18:14 +09:00
K Lange
330f697800 Embed version information in a 'kuroko' module (~= Python's 'sys', but I want to keep that name available for Python compatibility) 2021-01-07 20:00:31 +09:00
K Lange
99cb7c592f closure.__doc__ should be a dynamic field, not a method... 2021-01-07 19:59:47 +09:00
K. Lange
5df14689bf Tab completion for basic fields/methods in the repl 2021-01-07 18:47:36 +09:00
K. Lange
03ead15eaf Fix segfault on compile failure 2021-01-07 12:34:44 +09:00