Commit Graph

1391 Commits

Author SHA1 Message Date
K. Lange
8e5ace5112 Make classes for base types and exceptions 2021-01-01 12:04:58 +09:00
K. Lange
1dca833d6f add assignment shortcut operators (probably not worth using until optimizations are in place) 2021-01-01 10:42:16 +09:00
K. Lange
58132eedf8 Add binary operators 2021-01-01 08:55:39 +09:00
K. Lange
f745f8ec15 Add rudimentary (native) file i/o module 2020-12-31 18:41:17 +09:00
K. Lange
4df8cd8673 Docs, and also make negative indexes work as expected for strings at least... 2020-12-31 18:40:38 +09:00
K. Lange
2b3a5cec60 String slicing, and general syntax support 2020-12-31 18:32:37 +09:00
K. Lange
9a370f00e1 Add continue/break statements 2020-12-31 16:59:51 +09:00
K. Lange
aa3674dd32 implement shared object module support 2020-12-31 15:48:39 +09:00
K. Lange
c2e5eeceb7 Internal binding functions should look at the stack from the top, not the bottom; they may run with stuff on the stack... 2020-12-31 14:46:02 +09:00
K. Lange
0031048ff7 Fix missing nil terminator in _builtins_src[] 2020-12-31 13:50:17 +09:00
K. Lange
ede0e6e856 more README sections 2020-12-31 12:26:17 +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
90b8ba97dd fix closure example in README; needs 'let's 2020-12-31 07:58:33 +09:00
K. Lange
0b2c9df58f shove list comprehensions into their own fake call frames because everything is terrible 2020-12-30 22:30:09 +09:00
K. Lange
bb7e49add7 (repl) fix delay issues from old getch() implementation 2020-12-30 22:29:45 +09:00
K. Lange
33f7561076 List comprehensions, and several gc+scoping fixes along the way 2020-12-30 21:57:13 +09:00
K. Lange
f7e1c0da0d Add docstrings, __doc__, and help() 2020-12-30 16:59:21 +09:00
K. Lange
a5928b18c9 bite the bullet and rename length() to __len__() 2020-12-30 15:50:26 +09:00
K Lange
9fd9d81afe eliminate arbitrary size restrictions where possible 2020-12-29 06:33:16 +09:00
K. Lange
5c8d8942b1 make all classes inherit from object(), add __dir__ 2020-12-30 12:28:18 +09:00
K. Lange
f7e3a28408 int/float casts for strings 2020-12-30 11:26:07 +09:00
K. Lange
468136641f more README sections 2020-12-30 10:22:10 +09:00
K. Lange
1ae9828570 export should be able to take multiple arguments; fix resolution bug when export statement does not follow object to be exported 2020-12-30 10:19:52 +09:00
K. Lange
e731eca802 implement list and dict expressions 2020-12-30 09:05:20 +09:00
K. Lange
b19fc3a477 Add syntax for list/dict expressions 2020-12-30 09:01:52 +09:00
K. Lange
428c368a75 Support optional arguments by tracking separate arities 2020-12-30 08:00:48 +09:00
K. Lange
5ff31e7d96 fix parse error line output for error tokens from scanner 2020-12-29 22:16:35 +09:00
K. Lange
7f47224bd9 remove superfluous range module 2020-12-29 22:06:29 +09:00
K. Lange
267c7b5650 rudimentary character literal, specifically for bim syntax [sorry if you like single-quote strings in python] 2020-12-29 21:29:15 +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
7dfd853217 More stuff for embedding 2020-12-29 18:51:03 +09:00
K. Lange
4c651592f8 fix up some compiler eof stuff to make embedding more reasonable 2020-12-29 18:50:39 +09:00
K. Lange
eb17af8076 Embed __builtins__ source directly 2020-12-29 18:50:18 +09:00
K. Lange
b0c2772937 switch some type conversions to bound methods 2020-12-29 16:40:42 +09:00
K. Lange
2c18402d40 escape sequences in strings 2020-12-29 16:26:00 +09:00
K. Lange
edc963b014 reword README 2020-12-29 15:39:34 +09:00
K. Lange
c6e5c8c120 once again, completely redo the parsing for indentation so that we can have pretty syntax errors 2020-12-29 15:26:45 +09:00
K. Lange
54c3779938 fix up handling of exceptions in module imports 2020-12-29 13:19:22 +09:00
K. Lange
c91a861c99 Add some actually useful stuff to the readme 2020-12-29 12:51:31 +09:00
K. Lange
105e92f846 gobble more line feeds and handle eof condition on if/try without matching else/except 2020-12-29 12:40:19 +09:00
K. Lange
30cd3fb150 Allow empty blocks and merged single-line blocks 2020-12-29 12:26:26 +09:00
K. Lange
32d7d6f666 fix scanner issue with EOF after indentation 2020-12-29 12:24:48 +09:00
K. Lange
a0d52a61f2 add an exception mechanism 2020-12-29 11:00:12 +09:00
K. Lange
ba73f5a32a move stray test into test/ 2020-12-29 08:25:36 +09:00
K. Lange
0f7bc84ad3 for loops must open a new scope around their blocks as well or they won't pop locals before the loop finishes 2020-12-29 08:23:18 +09:00
K. Lange
9a580d6720 Add binding to configure debug tracing at runtime 2020-12-29 08:22:54 +09:00
K. Lange
56e7f3aa02 Not actually slower to include the debug branches 2020-12-29 08:22:37 +09:00
K Lange
e9261a2f56 change size of integers to long 2020-12-28 16:32:40 +09:00
K Lange
b32dde0431 add % operator 2020-12-28 16:32:27 +09:00
K Lange
27f888543d let's build things for a faster vm by default 2020-12-28 16:31:53 +09:00