Commit Graph

23 Commits

Author SHA1 Message Date
Adam Kelly
2b6cab4e97 Add JumpIfFalse instruction to avoid negation. 2018-08-24 18:23:05 +01:00
Windel Bouwman
04b786f0f3 Add try except to compiler 2018-08-22 21:42:18 +02:00
Windel Bouwman
f595553371 Add location vector to code object 2018-08-22 18:35:32 +02:00
Windel Bouwman
15e274210f Add float type 2018-08-20 21:22:14 +02:00
Daniel Watkins
2a90df80c8 Run cargo fmt to format the entire project 2018-08-10 20:23:15 -04:00
Daniel Watkins
a7428e3808 Implement complex import handling
This expands import parsing and handling to implement a variety of
import cases:

* `import x as y`
* `import x, y`
* `from x import y`
* `from x import y, z`
* `from x import y as z, a as b`

This fixes #51.
2018-08-09 17:14:08 -04:00
Adam Kelly
9df841b38b Set and retrieve attributes on instances. 2018-08-09 07:55:52 +01:00
Adam Kelly
ccfbe6c4ff Ability to define classes. 2018-08-09 07:51:26 +01:00
Adam Kelly
0d645bf1a9 Add PrintExpr instruction to vm. 2018-08-04 20:47:34 +01:00
Adam Kelly
b917efa8a8 Add compilation of lambdas and support function arguments. 2018-07-28 11:57:41 +01:00
yodalee
ea1b197831 add boolean constant
following program become runnable:
if True:
  print(1)
2018-07-19 21:33:41 +08:00
Windel Bouwman
8b6e0fe0b6 Add more arithmatic 2018-07-16 21:09:05 +02:00
Windel Bouwman
e47e5f3d05 Add else statement 2018-07-15 16:54:29 +02:00
Windel Bouwman
b653b96a46 Autoformatting 2018-07-15 13:16:00 +02:00
yodalee
ed0f45172b add pretty Debug implementation for CodeObject 2018-07-15 00:59:49 +08:00
Windel Bouwman
e6493ec996 Add new_instance method 2018-07-14 12:14:16 +02:00
Windel Bouwman
5187c2e974 Simple importing scheme working 2018-07-12 20:38:53 +02:00
Windel Bouwman
3349e24aad Early import mechanics 2018-07-11 23:33:59 +02:00
Windel Bouwman
ed4557fec5 Added cool script to test snippets in both implementations 2018-07-08 19:57:53 +02:00
Windel Bouwman
62cb3e2474 Add slice object 2018-07-08 12:38:55 +02:00
Windel Bouwman
b4e9064516 Try to repair cpython bytecode frontend 2018-07-08 00:22:30 +02:00
Windel Bouwman
3f98e3c64a Reverse dependency between vm and cpython bytecode adapter 2018-07-07 23:19:06 +02:00
Windel Bouwman
8470254f07 Move last compiler / vm pieces out of parser crate 2018-07-07 17:44:30 +02:00