Commit Graph

48 Commits

Author SHA1 Message Date
K. Lange
9211b04fc1 Add 'else if'; don't do Python's elif thing, I don't like that. 2021-01-02 12:13:01 +09:00
K. Lange
b42844f842 Fully internalize list+dict core methods and implement invokes for getters/setters 2021-01-01 20:52:18 +09:00
K. Lange
1242f2f10f try to namespace everything 2021-01-01 16:58:13 +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
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
0031048ff7 Fix missing nil terminator in _builtins_src[] 2020-12-31 13:50:17 +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
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
9fd9d81afe eliminate arbitrary size restrictions where possible 2020-12-29 06:33:16 +09:00
K. Lange
f7e3a28408 int/float casts for strings 2020-12-30 11:26:07 +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
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
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
4c651592f8 fix up some compiler eof stuff to make embedding more reasonable 2020-12-29 18:50:39 +09:00
K. Lange
2c18402d40 escape sequences in strings 2020-12-29 16:26:00 +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
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
a0d52a61f2 add an exception mechanism 2020-12-29 11:00:12 +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
b32dde0431 add % operator 2020-12-28 16:32:27 +09:00
K. Lange
3ba8025eeb lots of fixups so we can create dicts from the vm 2020-12-28 20:38:26 +09:00
K. Lange
b3ad2e1f22 Second pass at cleaning up built-ins 2020-12-28 19:26:01 +09:00
K Lange
ac15ca117c Clean up some pedantic warning stuff 2020-12-28 11:11:50 +09:00
K. Lange
3c0bd99a2e ssize_t usually comes from sys/types 2020-12-28 16:07:52 +09:00
K. Lange
0f508c38dc Add support for iterators 2020-12-28 13:35:02 +09:00
K. Lange
1d3368861b fix a bunch of compiler stuff 2020-12-28 12:16:44 +09:00
K. Lange
8f42695f36 Fix up repl 2020-12-28 10:54:25 +09:00
K. Lange
3bcc5d5530 Synthesized properties and methods for strings 2020-12-28 09:08:35 +09:00
K. Lange
01fdf1d86f remove superfluous debug prints 2020-12-27 22:48:22 +09:00
K. Lange
4982881235 that's a lot of stuff and pretty much finishes the book; need to do optimizations 2020-12-27 22:40:35 +09:00
K. Lange
1f754ebc01 not exactly how modules work in Python, but, uh, good enough for us for now 2020-12-27 18:55:52 +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
076da0bc1e remove temporary 'block' keyword 2020-12-27 10:58:36 +09:00
K. Lange
d90778c40c fix totally broken hexadecimal constants 2020-12-27 10:19:44 +09:00
K. Lange
81e3e133c8 finish up chapter 24 (functions, calls, native bindings) 2020-12-27 09:33:28 +09:00
K. Lange
df7ca60bdf and that's chapter 23... 2020-12-26 20:39:47 +09:00
K. Lange
aab01f01f7 Finish up chapter 22, local variables; fix up indentation-based scoping 2020-12-26 18:39:29 +09:00
K. Lange
928047f1db Completed chapter 21, global variables 2020-12-26 16:53:15 +09:00
K. Lange
14aeea5f5b through chapter 19 of Crafting Interpreters 2020-12-26 09:32:21 +09:00