38 Commits

Author SHA1 Message Date
K. Lange
85e7c667b4 C-ify some more collection methods 2021-01-19 22:27:05 +09:00
K. Lange
87c99d5c8f Add support for \U escape 2021-01-19 14:05:21 +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
d2d1c98a1e Add 'del' statement. 2021-01-14 16:08:25 +09:00
K. Lange
9015176bbb Cleanups clang asked for 2021-01-14 09:15:18 +09:00
K. Lange
10f3c16e40 Major overhaul of strings to support Unicode 2021-01-12 19:23:14 +09:00
K. Lange
eb27158173 Class fields and access to class member methods 2021-01-11 16:31:34 +09:00
K. Lange
ff7dcbb92a Support 'return' from within a 'with' block 2021-01-10 23:39:05 +09:00
K. Lange
997e1a8d2a length should determine truthiness where relevent 2021-01-09 13:58:46 +09:00
K. Lange
fbf4dda818 Fix tracking what should be 'global' through function calls? 2021-01-07 10:39:09 +09:00
K. Lange
902d2222b5 Make modules work like in Python. TODO: module class for better repring 2021-01-07 09:50:58 +09:00
K. Lange
3898e5e51c Store the names of locals in functions for debugging later 2021-01-06 15:03:56 +09:00
K. Lange
2f78ae8770 maybe support __eq__? 2021-01-05 17:41:32 +09:00
K. Lange
7a91678701 Use tuples to store range data for faster lookup 2021-01-05 11:39:20 +09:00
K. Lange
c8758c9ffb Add tuple type to store immutable lists 2021-01-05 11:38:11 +09:00
K. Lange
20d5ce47bf Work towards generalizing fast calls 2021-01-05 09:30:23 +09:00
K. Lange
b93429d6a6 Oops, fix strings; simplify bytecode around getters/setters; use this approach for slicing 2021-01-04 18:10:55 +09:00
K. Lange
fb9d0163ef Some more objects 2021-01-04 17:29:06 +09:00
K. Lange
0a042e7a38 Kinda shoddily support keyword args in native functions by shoving them on the end and setting a flag you can opt in to seeing 2021-01-03 16:23:22 +09:00
K. Lange
36716e3508 Support * and ** in function signatures for collections of additional arguments and keyword args 2021-01-03 16:02:50 +09:00
K. Lange
e46d753999 Basic support for keyword arguments when calling functions. 2021-01-03 12:09:41 +09:00
K. Lange
542e219192 Redefine list comprehension and add infix in 2021-01-02 19:46:21 +09:00
K. Lange
ae2e2be15d do something more straightforward and useful for methods on non-objects 2021-01-01 16:02:16 +09:00
K. Lange
764f9144f8 Add __base__, isinstance(), and track superclass in the VM and not just implicitly by super() calls. 2020-12-31 09:15:53 +09:00
K. Lange
f7e1c0da0d Add docstrings, __doc__, and help() 2020-12-30 16:59:21 +09:00
K. Lange
428c368a75 Support optional arguments by tracking separate arities 2020-12-30 08:00:48 +09:00
K. Lange
430f20566e allow native functions to be bound as methods with a little work 2020-12-29 20:31:35 +09:00
K. Lange
067d8cdb65 fix upvalue storage being completely broken when we move the stack 2020-12-28 22:02:39 +09:00
K Lange
ac15ca117c Clean up some pedantic warning stuff 2020-12-28 11:11:50 +09:00
K. Lange
1d3368861b fix a bunch of compiler stuff 2020-12-28 12:16:44 +09:00
K. Lange
0ca0564cd0 methods/initializers; haven't done invoke, want to add modules first then come back 2020-12-27 17:53:46 +09:00
K. Lange
f88e8de25d classes and instances (from ch 27) 2020-12-27 16:45:34 +09:00
K. Lange
1d0fac5640 Basic garbage collection; had to fix some stuff for stack preallocation 2020-12-27 16:07:27 +09:00
K. Lange
78022fb701 wrap up closure implementation from chapter 25 2020-12-27 13:02:26 +09:00
K. Lange
81e3e133c8 finish up chapter 24 (functions, calls, native bindings) 2020-12-27 09:33:28 +09:00
K. Lange
417637ef21 hash tables (which should work with any object as keys?) and string interning from ch 20 2020-12-26 14:33:34 +09:00
K. Lange
14aeea5f5b through chapter 19 of Crafting Interpreters 2020-12-26 09:32:21 +09:00