Commit Graph

35 Commits

Author SHA1 Message Date
ZapAnton
0e6fca0106 Fix the 'if_same_then_else' clippy warnings
Relevant clippy warning: https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else
2019-02-08 20:04:30 +03:00
Adam Kelly
fd344ec1e0 Remove unnecessary to_bigint().unwrap() everywhere. 2019-02-06 17:38:01 +00:00
Windel Bouwman
328f81a28e Merge pull request #266 from coolreader18/format-mk-module
Format module building in a more readable way
2019-01-30 18:09:17 +01:00
Windel Bouwman
892493e464 Rename PyObjectKind into PyObjectPayload 2019-01-30 18:06:27 +01:00
coolreader18
e9bfea834a Format module building in a more readable way 2019-01-28 23:02:43 -06:00
coolreader18
5ecff1b37e Remove unnecessary to_string conversions 2019-01-27 21:45:21 -06:00
coolreader18
8fee5a8800 Run cargo fmt --all 2018-12-27 00:12:08 -06:00
coolreader18
a77b7e0ce4 Have json.* throw an exception instead of panicking 2018-12-26 14:18:15 -06:00
Windel Bouwman
a29e882bc1 Store dict key as pyobject into hashmap. 2018-12-13 17:05:01 +01:00
Windel Bouwman
e657633e51 Move set_item to context struct. 2018-12-12 22:27:28 +01:00
Windel Bouwman
0215830aaa Move set_attr and set_item to context. 2018-12-12 19:41:09 +01:00
Windel Bouwman
d72abebdd0 Unify object kinds tuple and list into sequence. 2018-11-03 12:26:31 +01:00
Windel Bouwman
039b5bbbb7 Implement dict __setitem__ 2018-11-02 22:04:18 +01:00
Windel Bouwman
89cfdbe3dd Use __setitem__ to store elements in list. Also refactor get_elements to return a reference to the elements, not a copy. 2018-10-31 23:18:26 +01:00
Windel Bouwman
cb4d66bd48 Added bit length method on int type. 2018-10-30 22:08:10 +01:00
Windel Bouwman
f6cced5d65 Change integer type into bigint 2018-10-30 21:01:31 +01:00
Windel Bouwman
1d854a8fbb Modify isinstance call signature to take reference to a python reference. 2018-10-27 17:58:54 +02:00
Windel Bouwman
ce91a25106 Added -m option to main program. 2018-10-13 11:17:09 +02:00
Windel Bouwman
2d7b0e0d4b Moved objbool into obj folder 2018-09-29 09:38:07 +02:00
Daniel Watkins
8c167ac4f5 Clean up unwrapping of string objects in json.loads 2018-09-02 16:49:50 -04:00
Daniel Watkins
0e33aa397a Create objects with correct types in json.rs
Fixes #120.
2018-09-02 14:13:02 -04:00
Daniel Watkins
a4a91f14d4 Convert PyObjectSerializer to store a PyContext
We don't actually need anything from the VirtualMachine other than the
context, so just use that directly.
2018-09-02 14:13:02 -04:00
Windel Bouwman
1a2a4adcef Lets delete some clones 2018-09-02 19:41:37 +02:00
Adam Kelly
04b73d4628 Bool is a subclass of int, so doesn't need a special kind. 2018-09-02 14:10:36 +01:00
Adam Kelly
8d8816ce04 Merge branch 'master' into equality 2018-09-01 20:46:22 +01:00
Windel Bouwman
f563856dc4 Add some tuple class methods 2018-09-01 10:19:51 +02:00
Windel Bouwman
40cf7f4579 Move more objects to obj folder 2018-09-01 10:00:55 +02:00
Windel Bouwman
b2ab49376a Change get_value to take a reference to a reference 2018-08-31 20:49:52 +02:00
Windel Bouwman
f453c749ec Move builtin types to own directory 2018-08-31 20:31:25 +02:00
Daniel Watkins
406b9a1c57 Add PyObjectSerializer method to reduce clutter 2018-08-30 19:02:25 -04:00
Daniel Watkins
3dca52cc4a Rework json.dumps to support subclasses
We can currently only construct instances of string subclasses, so
that's the only code path that is actually tested.

Fixes #91.
2018-08-30 19:02:25 -04:00
Daniel Watkins
1c0e1ed6b5 Implement getters for PyContext types
Currently, all users of the *_type attributes on PyContext have to
immediately clone the pointer before they can use it; this pushes that
cloning in to getters to reduce the clone-clutter across the codebase.
2018-08-27 17:31:05 -04:00
Daniel Watkins
8f74759129 Modify arg_check! syntax to allow expansion of option types 2018-08-27 09:55:21 -04:00
Daniel Watkins
55402e27ad Use arg_check! in json module 2018-08-26 21:55:35 -04:00
Daniel Watkins
7a80c04725 Basic json module implementation in rust 2018-08-26 15:10:39 -04:00