Daniel Watkins
2cecd362fe
Add support for defaults to bytecode, compiler and VM
2018-08-29 08:58:20 -04:00
Windel Bouwman
0787115d07
Merge pull request #98 from OddBloke/ctx_getters
...
Implement getters for PyContext types
2018-08-28 19:33:32 +02: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
4f14411a0f
Merge pull request #97 from RustPython/objtyp
...
Move to more usage of type checking by typ
2018-08-27 16:53:46 -04:00
Windel Bouwman
819b88efb6
Move to more usage of type checking by typ
2018-08-27 22:40:29 +02:00
Daniel Watkins
12ebed8599
Move builtin_print to correct alphabetical position
2018-08-27 16:12:43 -04:00
Windel Bouwman
fdcc4c8992
Merge pull request #95 from RustPython/bools_3
...
Bools 3
2018-08-27 22:05:58 +02:00
Windel Bouwman
9b29ae058c
Merge pull request #96 from OddBloke/macro
...
Introduce optional parameter support in arg_checks!
2018-08-27 21:59:22 +02:00
Windel Bouwman
9b1c44edac
Merge pull request #86 from RustPython/exceptions
...
Add issiubclass
2018-08-27 21:52:46 +02:00
Daniel Watkins
970acbe47a
Use optional arg_checks! for bool_new
2018-08-27 09:55:34 -04:00
Daniel Watkins
f7b43ea617
Add optional positional arguments to arg_check!
2018-08-27 09:55:21 -04:00
Daniel Watkins
8f74759129
Modify arg_check! syntax to allow expansion of option types
2018-08-27 09:55:21 -04:00
Adam Kelly
a59c4536d9
unittests for compilation of if statements.
2018-08-27 14:26:13 +01:00
cthulahoops
3590d150e3
Merge pull request #93 from OddBloke/macro
...
Introduce arg_check! usage in more places
2018-08-27 14:23:23 +01:00
Adam Kelly
1e6ed66019
Implement compile_test to avoid extra evaluations of bools.
2018-08-27 14:04:53 +01:00
Daniel Watkins
55402e27ad
Use arg_check! in json module
2018-08-26 21:55:35 -04:00
Daniel Watkins
5176ebd3ed
Use arg_check! macro in objlist
2018-08-26 21:55:35 -04:00
Daniel Watkins
113f9be403
Move arg_check macro to a shared module
...
This allows it to be used by more than just the builtins module.
2018-08-26 21:55:35 -04:00
Daniel Watkins
09b89f95f4
Merge pull request #88 from OddBloke/macro
...
Add a macro for builtins argument checking
2018-08-26 21:55:18 -04:00
Daniel Watkins
87cf9ee0e6
Temporary fix for type elision in subtraction
...
This is the code path this is used in the tests; a full fix should
follow.
2018-08-26 17:19:58 -04:00
Daniel Watkins
d4693097d4
Use explicit types in arg type checking macro
2018-08-26 16:53:52 -04:00
Daniel Watkins
9db736e089
Update arg checking macro to perform type checking of arguments
2018-08-26 16:53:52 -04:00
Daniel Watkins
7105549c69
Add initial argument count checking macro
2018-08-26 16:53:52 -04:00
Windel Bouwman
3f7986c811
Address review comments
2018-08-26 22:01:00 +02:00
Windel Bouwman
b8552a22e5
Merge branch 'master' of https://github.com/RustPython/RustPython into exceptions
2018-08-26 21:51:51 +02:00
Windel Bouwman
2c14e92e24
Merge pull request #89 from OddBloke/json
...
Basic json module implementation in rust
2018-08-26 21:46:57 +02:00
Daniel Watkins
7a80c04725
Basic json module implementation in rust
2018-08-26 15:10:39 -04:00
Daniel Watkins
3255a55837
Rename types snippet to avoid shadowing stdlib module
2018-08-26 15:09:07 -04:00
Windel Bouwman
57287c8878
Merge pull request #87 from OddBloke/import
...
Un-mut some Frame/VirtualMachine methods
2018-08-26 19:38:23 +02:00
Daniel Watkins
9a77f2d559
Un-mut some Frame/VirtualMachine methods
...
They don't actually require mutable references.
2018-08-26 12:16:22 -04:00
Windel Bouwman
96ee1cce60
Add filename and row to traceback
2018-08-26 12:17:16 +02:00
Windel Bouwman
71896fd2aa
Merge branch 'master' of https://github.com/RustPython/RustPython into exceptions
2018-08-26 11:40:30 +02:00
Windel Bouwman
a833526223
Add traceback and msg to exception objects
2018-08-26 11:40:23 +02:00
Windel Bouwman
6ce1dbce26
Add issiubclass
2018-08-26 10:54:03 +02:00
cthulahoops
c295a4514c
Merge pull request #82 from RustPython/bools_2
...
Bools 2
2018-08-26 09:52:28 +01:00
Windel Bouwman
4ca3314d4c
Merge pull request #83 from OddBloke/import
...
Make imports relative to the importing file
2018-08-26 10:49:10 +02:00
Adam Kelly
de0dde21f0
Don't create extra JumpIfOrPop instructions.
...
As discussed:
https://github.com/RustPython/RustPython/pull/82#discussion_r212809238
2018-08-26 09:36:27 +01:00
Adam Kelly
e10dfa4f87
Compile and and or.
2018-08-26 09:36:27 +01:00
Adam Kelly
fb2c959cc4
Missing __bool__ is truthy and None is falsey.
2018-08-26 09:36:27 +01:00
Windel Bouwman
2053544199
Merge pull request #85 from RustPython/exceptions
...
Check that raise command raises exception type
2018-08-26 10:01:40 +02:00
Daniel Watkins
a457153ce1
Consider imports relative to their source
...
Currently they are considered relative to the current working directory
of the interpreter, which is incorrect.
Fixes #83 .
2018-08-25 19:45:19 -04: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
Daniel Watkins
eecddd417b
Distinguish between a mutable and non-mutable borrow of vm.current_frame
...
This renames the existing (mutable) VirtualMachine.current_frame to
current_frame_mut and introduces VirtualMachine.current_frame which is
(a) public, and (b) does not take a mutable reference.
(This also switches callers to use the non-mutable version where
possible.)
2018-08-25 19:35:48 -04:00
Windel Bouwman
a0edc4203f
Check that raise command raises exception type
2018-08-26 00:30:01 +02:00
Windel Bouwman
c41370a26f
Merge pull request #84 from OddBloke/newline
...
Don't double-count newlines in comments
2018-08-25 23:02:52 +02:00
Daniel Watkins
159a524f3f
Don't double-count newlines in comments
...
lex_comment doesn't consume the newlines, (correctly) leaving them to
the regular newline parsing. As such, it shouldn't call self.new_line,
or we end up double-counting lines.
2018-08-25 10:54:31 -04:00
cthulahoops
6aff83e2e5
Merge pull request #78 from RustPython/exceptions
...
Implement exception type checking at catch
2018-08-25 14:45:19 +01:00
Windel Bouwman
6aa9c01180
Merge branch 'master' of https://github.com/RustPython/RustPython into exceptions
2018-08-25 10:18:51 +02:00
Windel Bouwman
882606ba1a
Move exceptions to own struct
2018-08-25 10:11:21 +02:00
Windel Bouwman
81546c6f94
Merge pull request #81 from OddBloke/newline
...
Fix a couple of newline-in-string nits
2018-08-25 08:25:38 +02:00