Windel Bouwman
d72abebdd0
Unify object kinds tuple and list into sequence.
2018-11-03 12:26:31 +01:00
Windel Bouwman
810ef7df1c
Add bytearray object
2018-11-03 11:09:15 +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
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
1d854a8fbb
Modify isinstance call signature to take reference to a python reference.
2018-10-27 17:58:54 +02:00
Windel Bouwman
b03dd623c7
Add raw strings to lexer. Add line break continuation to lexer.
2018-10-27 10:30:11 +02:00
Windel Bouwman
09e2c027cd
Extend ast module with more nodes. Test send method on generators.
2018-10-24 16:02:59 +02:00
Windel Bouwman
e92ba94c61
Modify ast regarding keyword arguments.
2018-10-19 22:45:24 +02:00
Windel Bouwman
7728ee1e63
Minor change to keyword arguments in function call
2018-10-16 23:26:37 +02:00
Windel Bouwman
3eafcbec3d
Add decorator functionality
2018-10-14 20:04:19 +02:00
Windel Bouwman
133d72fcb1
Add tokenize module. Change call_method to take a reference to a PyObjectRef. Add new method to list class.
2018-10-14 15:21:48 +02:00
Windel Bouwman
8503a80433
Add initial types module
2018-10-14 13:09:44 +02:00
Windel Bouwman
d3b0c872ec
Add additional math functions to math module
2018-10-14 12:17:36 +02:00
Windel Bouwman
bccb6f3bf5
Add draft re module
2018-10-14 10:59:00 +02:00
Windel Bouwman
82af5b2981
Add struct unpack function
2018-10-14 09:43:09 +02:00
Windel Bouwman
5e27cc45b0
Initial struct module
2018-10-13 22:04:49 +02:00
Windel Bouwman
cef6707bef
Initial structure for io module
2018-10-13 11:36:51 +02:00
Windel Bouwman
ce91a25106
Added -m option to main program.
2018-10-13 11:17:09 +02:00
Windel Bouwman
bc60969091
Update formatting and readme file
2018-10-13 09:44:42 +02:00
Windel Bouwman
c94c5f7049
Add keyword module
2018-10-10 19:40:52 +02:00
Windel Bouwman
70c7f275cb
Create spiffy macro to generate math functions.
2018-10-10 19:15:36 +02:00
Windel Bouwman
e782342d36
Add initial math module
2018-10-10 18:54:19 +02:00
Windel Bouwman
2d7b0e0d4b
Moved objbool into obj folder
2018-09-29 09:38:07 +02: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
da7745cf27
Fix module type
2018-09-05 14:31:06 +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
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
Windel Bouwman
c687db079a
Merge pull request #107 from OddBloke/stdlib
...
Store Rust stdlib modules on VirtualMachine and lazily-load them
2018-08-31 19:47:47 +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
5e3c22e182
Only load Rust stdlib modules on import
...
Fixes #108
2018-08-30 11:50:21 -04:00
Daniel Watkins
8756c04cfe
Store Rust stdlib modules on VirtualMachine
...
This means we only have to load the modules once at startup.
Fixes #90 .
2018-08-30 11:15:09 -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