Daniel Watkins
99de3d6ef6
Fix some unused name warnings
2018-08-05 14:59:32 -04:00
Daniel Watkins
117fa24623
Unwrap the PyResult returned by builtin_print
2018-08-05 14:53:11 -04:00
Daniel Watkins
5554160981
Reduce builtin_str match to two arms
2018-08-05 14:49:43 -04:00
Daniel Watkins
04cff8c968
Remove unused imports (and reorder affected lines)
2018-08-05 14:40:28 -04:00
Daniel Watkins
cd940f13ba
Expand unimplemented message for Rem
2018-08-05 10:29:24 -04:00
Daniel Watkins
b8608bd513
Fix copy-paste error in str error message
2018-08-05 10:25:54 -04:00
yodalee
5da0432dda
add builtin_str a temp version
2018-08-05 16:06:59 +08:00
yodalee
f0f48d82bd
rearrange builtin function
2018-08-05 16:06:59 +08:00
yodalee
0d9d4c9ea4
add modulo in pyobject, vm
2018-08-05 16:06:49 +08:00
Windel Bouwman
7b599d4a8d
Merge pull request #31 from OddBloke/basic_range
...
Naive builtin range function
2018-08-04 22:59:22 +02:00
Daniel Watkins
164b5fe277
Implement naive range function
...
This just returns a list rather than a range object (which is what
CPython does), and only accepts a single integer argument.
Fixes #28 .
2018-08-04 16:25:07 -04:00
Daniel Watkins
cf7005602f
Implement new list creation with elements
2018-08-04 16:23:21 -04:00
Adam Kelly
1333e624f6
Add Single mode to compile.
2018-08-04 20:47:34 +01:00
Adam Kelly
0d645bf1a9
Add PrintExpr instruction to vm.
2018-08-04 20:47:34 +01:00
Windel Bouwman
9f0360947a
Use boolean short circuit in expression logic
2018-08-04 18:14:33 +02:00
Windel Bouwman
3ed0b39831
Idea for short circuit logic
2018-08-04 17:44:38 +02:00
Windel Bouwman
a585d897c8
Return none at end of function
2018-08-04 17:02:56 +02:00
Windel Bouwman
131c34a96b
Fix build
2018-08-04 12:38:40 +02:00
Windel Bouwman
0f4f130d08
Add early sys module
2018-08-04 10:59:13 +02:00
Windel Bouwman
908f85b473
Merge pull request #23 from OddBloke/slice
...
Parse steps notation and support (positive) steps for strings
2018-08-04 10:10:38 +02:00
Windel Bouwman
3a19053c5b
Merge pull request #24 from OddBloke/unimplemented
...
Add more information to unimplemented! panics
2018-08-04 10:07:11 +02:00
Daniel Watkins
2d2f999c3a
Emit a SetupLoop instruction during while loop compilation
...
This means that breaks within while loops function correctly (as they
have a block that they can reference to work out where to jump to).
2018-08-04 01:25:28 -04:00
Daniel Watkins
b8a6662ca8
Negative steps for strings are unimplemented!
2018-08-04 00:56:20 -04:00
Daniel Watkins
13e421a979
Add more information to unimplemented! panics
2018-08-04 00:53:01 -04:00
Daniel Watkins
705c1c7dee
Implement stepped slicing for strings
2018-08-03 20:56:47 -04:00
Daniel Watkins
3b81f806ab
Retain the previous locals output format
2018-08-02 19:18:35 -04:00
Daniel Watkins
e768f06d94
Panic on unexpected locals instead of just logging
2018-08-02 19:14:26 -04:00
Daniel Watkins
b95c473121
Output locals mapping in trace logging
...
The Locals line in the Frame Object output is now, for example:
Locals: {"num": RefCell { value: [PyObj int 9] }, "f": RefCell { value: [PyObj function] }}
2018-08-02 15:38:20 -04:00
Windel Bouwman
eb2cc5b055
Change rt to vm and change args into an object holding both args and kwargs
2018-08-02 17:28:33 +02:00
Windel Bouwman
f7aa1dd822
Remove executor trait since we can have mutual includes
2018-08-01 22:22:19 +02:00
Daniel Watkins
f11b4fa6ca
Rename import argument to reflect changed type
2018-07-31 22:44:12 -04:00
Daniel Watkins
1bb6ead060
Use a scope (with builtins) for module import
...
This allows modules to use builtins (such as print). This fixes, for
example, `cargo run -- -c 'import demo'`.
2018-07-31 22:44:12 -04:00
Windel Bouwman
dbae0b0a71
Add builtin id function
2018-07-31 14:28:19 +02:00
Windel Bouwman
794313cadb
Merge pull request #16 from nyirog/master
...
vm/import: add module name to the message of NotFound error
2018-07-30 21:01:56 +02:00
Nyiro Gergo
77e80bc42c
vm/import: add module name to message of NotFound error
2018-07-29 10:43:10 +02:00
Windel Bouwman
86ebe8bb96
Added closures
2018-07-28 18:43:23 +02:00
Windel Bouwman
b855b5fc7a
Add scope object to to_str function
2018-07-28 18:21:30 +02:00
Windel Bouwman
d74f6f55d3
Merge branch 'master' of github.com:RustPython/RustPython
2018-07-28 17:42:49 +02:00
Windel Bouwman
b9adb4e926
Add environment thingy
2018-07-28 17:42:45 +02:00
Windel Bouwman
cc7770491d
Merge pull request #14 from nyirog/master
...
vm/import: support package import
2018-07-28 17:28:04 +02:00
Nyiro Gergo
0bb3a4a01c
vm/import: support package import
...
Module of the package cannot be imported directly yet.
2018-07-28 17:11:55 +02:00
Adam Kelly
b917efa8a8
Add compilation of lambdas and support function arguments.
2018-07-28 11:57:41 +01:00
Windel Bouwman
e7cc6b1786
Add else clause to for loop
2018-07-24 22:30:45 +02:00
Windel Bouwman
4a96783b54
Merge pull request #9 from yodalee/add-bool-constant
...
Add bool constant
2018-07-20 21:57:28 +02:00
Windel Bouwman
2d2ee85bf6
Change block stack unwind a little bit
2018-07-19 21:57:14 +02:00
yodalee
ea1b197831
add boolean constant
...
following program become runnable:
if True:
print(1)
2018-07-19 21:33:41 +08:00
yodalee
2b28390153
resume debug code object print at startup
...
Impl more detail debug message for pyobject kind
2018-07-19 21:33:09 +08:00
Windel Bouwman
000f889222
Add compile builtin
2018-07-18 14:45:53 +02:00
Windel Bouwman
de29e7fdc7
Add spiffy dir function
2018-07-18 11:40:43 +02:00
Windel Bouwman
bbc19305f8
Reduce dependencies of vm and parser crates
2018-07-18 10:22:00 +02:00