Commit Graph

53 Commits

Author SHA1 Message Date
Gitea
ac3da8b453 Add 'from x import *' syntax.
This is a separate opcode in CPython so I added it as such here.
2018-12-22 22:40:02 -05:00
Windel Bouwman
5ffb20b26e Add builtin oct function. Add weakref.ref class. 2018-11-04 12:07:53 +01:00
Windel Bouwman
17fc5a2345 Implemented hexadecimal, octal and binary literals. Also use bigint in the lexer to store big integer literals. 2018-11-04 09:00:44 +01:00
Windel Bouwman
bddaf3e77e Implement while-else and for-else. Call __neg__ and __invert__ methods on unary operation. 2018-10-31 21:50:00 +01:00
Windel Bouwman
1e3b45ee0d Add complex basic type 2018-10-29 21:55:58 +01:00
Windel Bouwman
5053d6d167 Add bytes literal support. 2018-10-28 21:15:46 +01:00
Windel Bouwman
e6fd9fb0a0 Add double star arguments in function calls 2018-10-28 20:05:05 +01:00
Windel Bouwman
3f6c716b37 Implement star expand argument in function call. 2018-10-28 19:16:21 +01:00
Windel Bouwman
4187a6ee39 Add support for star expanded argument in list and tuple constructions. 2018-10-28 14:16:11 +01:00
Windel Bouwman
1f30693718 Allow unpack in assignment of list as well as trailing comma for 1 sized tuples 2018-10-28 00:26:24 +02:00
Windel Bouwman
a3a427c252 Add 'yield from' syntax 2018-10-27 17:05:22 +02:00
Windel Bouwman
acefe3841e Add initial generator builtin type 2018-10-23 21:27:40 +02:00
Windel Bouwman
1222830678 Implement star arg on left hand side of assignment. 2018-10-22 21:52:06 +02:00
Windel Bouwman
f59f8a9567 Add support for *args and **kwargs in functions. 2018-10-21 20:48:08 +02:00
Windel Bouwman
940c41bda8 Reduce lalrpop generated code size by about half. Relates to issue #173. 2018-10-21 16:01:39 +02:00
Windel Bouwman
7e45d0b8b4 Add del statement 2018-10-19 18:41:44 +02:00
Windel Bouwman
e334941728 Removal of Clone trait on ast nodes. Should reduce codesize somewhat. 2018-10-17 22:04:02 +02:00
Windel Bouwman
96d35ad4f9 Generalize comprehensions for list, dict and set. 2018-10-17 20:10:26 +02:00
Windel Bouwman
a450c0e3da Add builtin type set 2018-10-17 17:14:46 +02:00
Windel Bouwman
6105a836ad Initial variant of list comprehensions 2018-10-17 12:05:10 +02:00
Windel Bouwman
9bf1cb3db8 First simple variant of with-statement operational. 2018-09-10 21:20:23 +02:00
Windel Bouwman
0f148e1214 Merge branch 'master' of https://github.com/RustPython/RustPython into with 2018-09-10 20:10:38 +02:00
Windel Bouwman
1eab9165bf Initial work on 'with' context manager logic 2018-09-10 20:10:31 +02:00
Adam Kelly
a14b776a81 Add tuple packing/unpacking assignment. (tuples only) 2018-09-09 21:19:56 +01:00
Windel Bouwman
8b3a95c562 Add code object name to traceback 2018-09-02 11:54:52 +02:00
Daniel Watkins
764e0af433 Emit CallFunctionKw from compiler for kwarg calls 2018-08-31 15:46:07 -04:00
Daniel Watkins
d4461d7703 Add bytecode::Constant::Tuple 2018-08-29 18:51:25 -04:00
Daniel Watkins
2cecd362fe Add support for defaults to bytecode, compiler and VM 2018-08-29 08:58:20 -04:00
Adam Kelly
a59c4536d9 unittests for compilation of if statements. 2018-08-27 14:26:13 +01:00
Daniel Watkins
767ceaefb5 Start storing the source_path of a code object
This will be required for (at least) import and exception display.
2018-08-25 19:45:19 -04:00
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