Commit Graph

1690 Commits

Author SHA1 Message Date
rmliddle
1e1e9d2669 divmod builtin 2018-09-13 08:00:52 +10:00
Windel Bouwman
1110bdeb79 Add prototype of context manager handling during exceptions. 2018-09-12 21:26:26 +02:00
Windel Bouwman
e5615593bd Merge pull request #139 from RustPython/with
With statement implementation
2018-09-12 20:35:14 +02:00
Windel Bouwman
013964549b Add example with two context managers in a single with statement 2018-09-12 19:25:21 +02:00
Windel Bouwman
638af166df Process review comments 2018-09-12 19:13:34 +02:00
Windel Bouwman
7b005c75a3 Merge branch 'master' of https://github.com/RustPython/RustPython into with 2018-09-12 19:05:29 +02:00
Windel Bouwman
8a28d1f2fc Merge pull request #142 from OddBloke/clippy
Accept slices to function calls
2018-09-12 19:05:12 +02:00
rmliddle
77772abedf div_mod attribute on float and int 2018-09-12 22:56:57 +10:00
Daniel Watkins
23910f78e7 Accept slices to function calls
Instead of allocated types, per [0].

[0] https://rust-lang-nursery.github.io/rust-clippy/v0.0.212/index.html#ptr_arg
2018-09-11 15:05:33 -04:00
Windel Bouwman
797e7f341f Merge branch 'master' of https://github.com/RustPython/RustPython into with 2018-09-11 19:21:13 +02:00
Windel Bouwman
6388891ac6 Merge pull request #141 from OddBloke/clippy
Apply some clippy lints
2018-09-11 19:20:43 +02:00
Windel Bouwman
28d58550df Merge pull request #140 from OddBloke/import
Cache imported modules in sys.modules
2018-09-11 19:19:36 +02:00
rmliddle
256d518c4a floordiv, float mod 2018-09-11 21:56:08 +10:00
Daniel Watkins
5a27e34e4c Pass label by value to VirtualMachine.jump()
Per [0], this is more efficient for usize.

[0] https://rust-lang-nursery.github.io/rust-clippy/v0.0.212/index.html#trivially_copy_pass_by_ref
2018-09-11 00:11:03 -04:00
Daniel Watkins
5a68005388 Remove needless .ok() calls in main.rs 2018-09-11 00:11:03 -04:00
Daniel Watkins
d88917f5a2 Remove needless clone of scope in main.rs 2018-09-11 00:11:03 -04:00
Daniel Watkins
ea7f6b4d37 Pass a string slice around in main.rs
We only need to convert it to a String once we're passing it in to
compile::compile.
2018-09-11 00:11:03 -04:00
Daniel Watkins
c5e36e8530 Ignore clippy warnings in lalrpop generated code 2018-09-11 00:11:03 -04:00
Daniel Watkins
a5b6f28167 Cache imported modules in sys.modules 2018-09-10 23:40:06 -04: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
Windel Bouwman
803a823d51 Merge pull request #138 from RustPython/assignment
Assignment
2018-09-10 19:45:22 +02:00
rmliddle
43489bed4c added abs builtin, __abs__ attributes on float and int objects 2018-09-10 23:01:07 +10:00
cthulahoops
d443c6428b Merge pull request #136 from RustPython/objtyp
Objtyp
2018-09-09 21:35:38 +01:00
Adam Kelly
a14b776a81 Add tuple packing/unpacking assignment. (tuples only) 2018-09-09 21:19:56 +01:00
Adam Kelly
b48d77b78e Add tests to check assignment works with tuple unpacking. 2018-09-09 21:19:27 +01:00
Windel Bouwman
de9c11c7c5 Move nxt function from pyobject to objiter file. Also fix formatting issues. 2018-09-09 20:55:03 +02:00
Windel Bouwman
0acfc10a09 Merge with master branch 2018-09-09 20:36:42 +02:00
Windel Bouwman
9f06835ca0 Add built-ins next and iter 2018-09-09 20:35:48 +02:00
Windel Bouwman
903bf41a7a Merge pull request #135 from rmliddle/added_builtins
implemented pow builtin
2018-09-09 19:43:45 +02:00
rmliddle
06f3506b62 formatting fixes on builtin_pow 2018-09-09 00:34:08 +10:00
rmliddle
abba4ae9cc implemented pow builtin 2018-09-09 00:05:13 +10:00
cthulahoops
416e48b12e Merge pull request #134 from RustPython/objtyp
Initial attempt at ast builtin module
2018-09-07 09:45:23 +01:00
Windel Bouwman
da7745cf27 Fix module type 2018-09-05 14:31:06 +02:00
Windel Bouwman
ac3c18cf4a Add module type 2018-09-05 14:16:36 +02:00
Windel Bouwman
51885f29fc Added more ast to pyast transformations 2018-09-05 14:06:16 +02:00
Windel Bouwman
f914b4848f Add two asserts to the ast snippets to check attributes of ast nodes. 2018-09-05 12:36:28 +02:00
Windel Bouwman
6293117886 Initial attempt at ast builtin module 2018-09-04 21:07:57 +02:00
cthulahoops
ba78000fc0 Merge pull request #129 from RustPython/objtyp
Implement dir on object
2018-09-03 21:14:23 +01:00
Windel Bouwman
64b04d0a91 Move get_attributes to objtype file 2018-09-03 21:39:16 +02:00
Windel Bouwman
9fa10c7c1a Merge with master 2018-09-03 21:30:05 +02:00
Daniel Watkins
e0609823b3 Merge pull request #133 from RustPython/bools_are_a_doubleton
Add true_value and false_value to context.
2018-09-03 14:45:17 -04:00
Adam Kelly
6068ef6a7a Update json tests to use is. 2018-09-03 19:24:02 +01:00
Adam Kelly
1bb7579f7c Add true_value and false_value to context. 2018-09-03 19:21:24 +01:00
cthulahoops
9394fec620 Merge pull request #128 from OddBloke/json
Create objects with correct types in json.rs
2018-09-03 19:00:25 +01:00
cthulahoops
46b306848f Merge pull request #131 from OddBloke/int
Implement no-args int() construction
2018-09-02 22:33:58 +01:00
Daniel Watkins
10f0ef33d6 Implement no-args int() construction 2018-09-02 17:00:35 -04:00
Daniel Watkins
8c167ac4f5 Clean up unwrapping of string objects in json.loads 2018-09-02 16:49:50 -04:00
Windel Bouwman
947c17eb84 Improve int type error 2018-09-02 21:49:56 +02:00