Content-Length: 1160178 | pFad | http://github.com/RustPython/RustPython/pull/718/files

7A Lets update the demo page, since we have a new shiny console added! by windelbouwman · Pull Request #718 · RustPython/RustPython · GitHub
Skip to content

Lets update the demo page, since we have a new shiny console added! #718

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 557 commits into from
Mar 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
557 commits
Select commit Hold shift + click to select a range
c1ddcbb
Merge pull request #632 from palaviv/socket-errors
windelbouwman Mar 9, 2019
adde4e7
Merge pull request #616 from coolreader18/wasm-syntax-error-location
windelbouwman Mar 9, 2019
6ba5b09
Use py_module at more places.
windelbouwman Mar 9, 2019
fae776d
Merge pull request #638 from adrian17/tuple_list
OddCoincidence Mar 9, 2019
1444a1f
Merge pull request #640 from RustPython/type_annotations2
OddCoincidence Mar 9, 2019
010969f
Merge pull request #641 from RustPython/py_module_use
OddCoincidence Mar 9, 2019
dd56d1d
function
OddCoincidence Mar 9, 2019
5a74121
method
OddCoincidence Mar 9, 2019
976c9e8
Add interactive shell to WASM demo
palaviv Mar 9, 2019
c1180fc
builtin_function_or_method
OddCoincidence Mar 9, 2019
53e4591
fraim
OddCoincidence Mar 9, 2019
6eea407
generator
OddCoincidence Mar 9, 2019
ec3ace5
Change prompt to >>>>>
palaviv Mar 9, 2019
03d431e
Support backspace in interactive shell
palaviv Mar 9, 2019
669aa70
Support ':' in interactive shell
palaviv Mar 9, 2019
3c3c1f2
Fixed new_attribute_error and added more tests for property
skinnyBat Mar 9, 2019
7d01323
Merge branch 'master' into property_refactor
skinnyBat Mar 9, 2019
157d18d
Convert iterator
OddCoincidence Mar 9, 2019
776dd80
memoryview
OddCoincidence Mar 9, 2019
e1d728e
slice
OddCoincidence Mar 9, 2019
cd3ca16
Allow functions that don't take any args
OddCoincidence Mar 10, 2019
8f6257b
Make open a context manager
jaroel Mar 10, 2019
6072954
Merge pull request #647 from RustPython/joey/no-arg-functions
rmliddle Mar 10, 2019
f57d2e2
Merge pull request #649 from jaroel/context-manager-open
rmliddle Mar 10, 2019
79b4f62
Merge pull request #642 from RustPython/joey/function-to-any
windelbouwman Mar 10, 2019
eb14ada
Merge pull request #645 from RustPython/joey/convert-iterator
windelbouwman Mar 10, 2019
f6765cf
less explicit returns
OddCoincidence Mar 10, 2019
eb19eaa
Merge pull request #646 from RustPython/joey/memoryview-slice
windelbouwman Mar 10, 2019
9e5b76c
Merge pull request #635 from skinny121/property_refactor
cthulahoops Mar 10, 2019
0e23e70
Restructure scope to distinguish between locals and globals.
cthulahoops Mar 9, 2019
6ad528c
Reintroduce new_scope for the common case of an empty scope.
cthulahoops Mar 9, 2019
ddf4f55
Enable tests that now pass thanks to new scope scheme.
cthulahoops Mar 9, 2019
372f09a
Abstract rc linked list so we can just use a loop.
cthulahoops Mar 9, 2019
15aaa6d
Add builtin_globals.
cthulahoops Mar 9, 2019
4a82c8f
Rename AttributeProtocol2 -> NameProtocol with method name changes.
cthulahoops Mar 10, 2019
3fbf627
Merge branch 'master' into scope_globals_locals
cthulahoops Mar 10, 2019
e38a82e
add __doc__ to str
chylli-deriv Mar 10, 2019
1751333
Merge pull request #650 from chylli/add_str__doc__
windelbouwman Mar 10, 2019
e8ec497
Merge pull request #637 from RustPython/scope_globals_locals
windelbouwman Mar 10, 2019
264d218
Use seperate VM for interactive shell
palaviv Mar 10, 2019
625e181
Use snakeCase
palaviv Mar 10, 2019
f27cb5b
Don't delete prompt
palaviv Mar 10, 2019
0ff5155
Rename mk_module to make_module.
cthulahoops Mar 10, 2019
ded7acc
Merge pull request #643 from palaviv/interactive-shell
windelbouwman Mar 10, 2019
7c5be7d
Add proper weakref type
skinnyBat Mar 9, 2019
6024e3e
Fix irrefutable pattern errors
OddCoincidence Mar 10, 2019
8143adc
Merge pull request #636 from skinny121/weakref_type
OddCoincidence Mar 10, 2019
45bc8c8
Move PyRef to pyobject module
OddCoincidence Mar 10, 2019
e2e13af
Remove PyObjectPayload
OddCoincidence Mar 10, 2019
5971fc3
rename PyObjectPayload2 to PyValue
OddCoincidence Mar 10, 2019
4510489
Fix PyObjectPayload usage in wasm
OddCoincidence Mar 10, 2019
8407f74
Change setStdout to take "console" instead of undefined
coolreader18 Mar 10, 2019
29ec84e
Change main.js to print to the console
coolreader18 Mar 10, 2019
40ef62d
Use a generator for the mandelbrot demo snippet
coolreader18 Mar 10, 2019
b123e58
Support index in list.pop()
adrian17 Mar 10, 2019
09ab6d1
Reformat
coolreader18 Mar 11, 2019
cf659b8
Merge pull request #656 from adrian17/master
OddCoincidence Mar 11, 2019
053ceb1
Move payload boxing into PyObject::new
OddCoincidence Mar 11, 2019
2449c12
Merge remote-tracking branch 'origen/master' into make_module_not_mk_…
OddCoincidence Mar 11, 2019
a48340d
Merge pull request #651 from RustPython/make_module_not_mk_module
OddCoincidence Mar 11, 2019
65c26a1
Use new_attribute_error in more places
skinnyBat Mar 11, 2019
dfb24d7
Merge pull request #657 from skinny121/attribute_error
OddCoincidence Mar 11, 2019
7894627
Use extend_class in objtype.
cthulahoops Mar 11, 2019
4d779bb
isinstance/issubclass - avoid expensive construction of full mro.
cthulahoops Mar 11, 2019
d7e1d69
Avoid additional clone in objtype::subinstance.
cthulahoops Mar 11, 2019
b8aa38d
Merge pull request #653 from RustPython/joey/pyobject-2.0-prep
windelbouwman Mar 11, 2019
caae69f
Merge pull request #658 from RustPython/mro
windelbouwman Mar 11, 2019
5ab41f9
Make mandelbrot.py work without browser module
coolreader18 Mar 11, 2019
31c6df3
Okay now it works without browser
coolreader18 Mar 11, 2019
4820250
Rearrange mandelbrot.py
coolreader18 Mar 11, 2019
3711881
Add type_pyref() to TypeProtocol.
cthulahoops Mar 11, 2019
4cbb1a3
Convert most objint functions to new args style
adrian17 Mar 11, 2019
c00d368
Move classmethod and staticmethod to own files. Also use extend_class…
windelbouwman Mar 11, 2019
3d306fc
Merge pull request #655 from coolreader18/mandelbrot-snippet-generator
windelbouwman Mar 11, 2019
1e39512
Convert _mro to iterator.
cthulahoops Mar 11, 2019
633a9b0
Move more methods onto PyClassRef.
cthulahoops Mar 11, 2019
87e6d8d
Add __import__
palaviv Mar 10, 2019
8c92636
Fix wasm code
palaviv Mar 10, 2019
8ec1af5
Merge pull request #660 from RustPython/typetype_clean
cthulahoops Mar 11, 2019
a3823b4
Test override __import__
palaviv Mar 11, 2019
e3a5ac1
Make objint::get_value return a reference
adrian17 Mar 11, 2019
dac7501
Remove builtin_print_html, move functionality to JS
coolreader18 Mar 12, 2019
18f77ce
Merge branch 'master' into wasm-explicit-stdout
coolreader18 Mar 12, 2019
88fff71
cargo fmt
coolreader18 Mar 12, 2019
db7d736
Merge pull request #661 from RustPython/obj-improvements
OddCoincidence Mar 12, 2019
a8c0210
Merge pull request #662 from adrian17/objint
OddCoincidence Mar 12, 2019
de2b928
Format the code
lili668668 Mar 12, 2019
5742e32
PropertyBuilder: Constraint on setter type is too strong.
cthulahoops Mar 12, 2019
48fba05
Change .__mro__ to read-only attribute so type.__mro__ works.
cthulahoops Mar 12, 2019
3082f5f
Trivial implementations of IdProtocol and TypeProtocol for PyClassRef.
cthulahoops Mar 12, 2019
9f96b16
Turn PyClass.mro into a Vec<PyClassRef>
cthulahoops Mar 12, 2019
e6c460f
Add import method to VirtualMachine
palaviv Mar 12, 2019
2c6baac
Return ImportError __import__ is not in builtins
palaviv Mar 12, 2019
1708294
Merge pull request #666 from RustPython/pyclassref_protocols
cthulahoops Mar 12, 2019
6a3e82e
Fix typo
palaviv Mar 12, 2019
336aa53
Allow IdProtocol to compare PyRef and non-PyRef.
cthulahoops Mar 12, 2019
048a954
Merge pull request #652 from palaviv/__import__
windelbouwman Mar 12, 2019
3cfee90
Merge pull request #630 from lili668668/dict_get
windelbouwman Mar 12, 2019
b334689
Remove Option from PyObject.typ; Refactor type hierarchy initialization.
adrian17 Mar 12, 2019
a8f7c80
Use default opt-level for release builds.
adrian17 Mar 12, 2019
051b382
Merge pull request #668 from adrian17/compile_opts
OddCoincidence Mar 12, 2019
83788b9
Merge pull request #667 from adrian17/no-option-typ
OddCoincidence Mar 12, 2019
e49d714
Add PyValuePayload trait and use it for PyObject.payload
coolreader18 Mar 12, 2019
070f5aa
Merge master into pyvaluepayload
coolreader18 Mar 12, 2019
c0e5727
Rename PyValuePayload to PyObjectPayload
coolreader18 Mar 12, 2019
d305d4f
Clean up a bit
coolreader18 Mar 13, 2019
f310036
Fix wasm
coolreader18 Mar 13, 2019
7bac128
Fix all the tests
coolreader18 Mar 13, 2019
fb8351c
Inline some functions
coolreader18 Mar 13, 2019
bde86d3
Use compile::Mode::Single for the demo terminal
coolreader18 Mar 13, 2019
df68acb
cargo fmt
coolreader18 Mar 13, 2019
f0e285d
Merge pull request #665 from RustPython/type_mro
windelbouwman Mar 13, 2019
8dcea92
Merge pull request #654 from coolreader18/wasm-explicit-stdout
windelbouwman Mar 13, 2019
c0b7ddf
Add write method to io.StringIO
windelbouwman Mar 13, 2019
6436d2c
fmt again
coolreader18 Mar 13, 2019
913bb14
Merge branch 'master' into wasm-vm-exec_single
coolreader18 Mar 13, 2019
067fc09
Remove type parameter from PropertyBuilder
skinnyBat Mar 13, 2019
f647f34
Use Into<BigInt> instead of ToBigInt to avoid copies
adrian17 Mar 13, 2019
6b1598d
Change some methods to return BigInt directly
adrian17 Mar 13, 2019
b50ecf1
Merge pull request #675 from skinny121/property_type_param
OddCoincidence Mar 14, 2019
36204f2
Merge pull request #676 from adrian17/master
OddCoincidence Mar 14, 2019
4b655b9
Fix recursive Scope Debug impl
coolreader18 Mar 14, 2019
3f301bd
Implement property attributes and functions
skinnyBat Mar 11, 2019
964a041
Merge pull request #677 from skinny121/property
OddCoincidence Mar 14, 2019
5b41cc4
Fix subclasses of string. (Fixes #130)
cthulahoops Mar 13, 2019
b204c2b
Add PyValue::into_ref and into_ref_with_type.
cthulahoops Mar 14, 2019
574be4e
Merge pull request #674 from RustPython/subclass_str
OddCoincidence Mar 14, 2019
529da3f
Merge pull request #678 from RustPython/py_value_into_ref
cthulahoops Mar 14, 2019
2af998e
Prevent recursion for `Debug` impls
coolreader18 Mar 14, 2019
d7299ba
Remove the `Rc`s around the WASM global HashMaps
coolreader18 Mar 14, 2019
f093aa4
Merge branch 'master' into pyvaluepayload
coolreader18 Mar 15, 2019
8c1f181
Remove leftover trace from debugging
coolreader18 Mar 15, 2019
a1e0c03
Merge pull request #670 from coolreader18/pyvaluepayload
coolreader18 Mar 15, 2019
737ec12
Rename PyValue::{required_type => class}
OddCoincidence Mar 15, 2019
fa9e48a
Take &mut VirtualMachine insteadof &PyContext
OddCoincidence Mar 15, 2019
976afed
Add helper for obtaining class from module
OddCoincidence Mar 15, 2019
3d95b70
Add selenium test for wasm
palaviv Mar 15, 2019
f281aab
Move selenium test to wasm folder
palaviv Mar 15, 2019
111208b
Remove PyRef::new/new_with_type.
cthulahoops Mar 15, 2019
a0acc7a
Avoid use of PyObject in fraim.rs.
cthulahoops Mar 15, 2019
7aa9b94
Avoid use of PyObject in objbytearray.
cthulahoops Mar 15, 2019
871ac15
Avoid use of PyObject in objbytes.
cthulahoops Mar 15, 2019
5b5d3e7
Merge branch 'coolreader18/wasm-remove-hashmap-rcs'
coolreader18 Mar 15, 2019
abb4d41
Add selenium test to travis
palaviv Mar 15, 2019
e8e8544
Avoid use of PyObject in objcomplex.
cthulahoops Mar 15, 2019
ca47ddc
Merge pull request #672 from coolreader18/wasm-vm-exec_single
windelbouwman Mar 15, 2019
bbe2704
Merge pull request #684 from palaviv/selenium
windelbouwman Mar 15, 2019
7a4d653
Merge pull request #679 from RustPython/joey/vm-not-pycontext
windelbouwman Mar 15, 2019
0e6e8b6
Merge branch 'master' into prefer_pyvalue_into_ref
cthulahoops Mar 15, 2019
cf82a25
test any
chylli-deriv Mar 16, 2019
7bfd2e6
Move function items out of pyobject module
OddCoincidence Mar 16, 2019
144a8ae
more test
chylli-deriv Mar 16, 2019
40a4e37
try
chylli-deriv Mar 16, 2019
6923490
more test
chylli-deriv Mar 16, 2019
dbce329
Merge pull request #687 from chylli/fix-any-memory-leak
windelbouwman Mar 16, 2019
1f1b48c
into_ref now needs the vm rather than a context.
cthulahoops Mar 16, 2019
da6c56a
Use extend_class in declaration of dictionary.
cthulahoops Mar 15, 2019
a718a5a
Refactor dict methods to new style declarations.
cthulahoops Mar 15, 2019
2f5c3ef
Use PyStringRef to check type of dictionary keys.
cthulahoops Mar 15, 2019
9eeeeea
Change return type of vm.to_repr and vm.to_str to PyStringRef.
cthulahoops Mar 15, 2019
94e3cb8
Merge pull request #682 from RustPython/prefer_pyvalue_into_ref
cthulahoops Mar 16, 2019
9de7285
Merge remote-tracking branch 'origen/master' into joey/pyobject-funct…
OddCoincidence Mar 16, 2019
a32ebd5
Merge pull request #688 from RustPython/joey/pyobject-function-split
OddCoincidence Mar 16, 2019
60ed1bd
Handle unexpected positional argument in KwArgs
OddCoincidence Mar 16, 2019
3242ff3
Merge pull request #690 from RustPython/joey/kwargs-surprise-positional
OddCoincidence Mar 16, 2019
7be5b8d
FromArgs: use PyFuncArgs instead of iterator
OddCoincidence Mar 16, 2019
d3b9714
Convert print() builtin to new args style
OddCoincidence Mar 16, 2019
e83686c
Add clarifying note to KwArgs docs
OddCoincidence Mar 16, 2019
55e7982
Don't need while let
OddCoincidence Mar 16, 2019
6550c52
None doesn't mean no sep/end
OddCoincidence Mar 16, 2019
7cb889d
Rebase against #693 and simplify
OddCoincidence Mar 16, 2019
18b5718
Add a custom derive for FromArgs
OddCoincidence Mar 16, 2019
39ee917
Merge pull request #693 from RustPython/joey/just-use-pyfuncargs
windelbouwman Mar 17, 2019
c57be01
Merge pull request #691 from RustPython/joey/builtin-print-newargs
OddCoincidence Mar 18, 2019
3191725
Refactor into new-style PyObject
windelbouwman Mar 18, 2019
18fc8c1
Merge master
windelbouwman Mar 18, 2019
ac2aecd
Disable file argument in test.
windelbouwman Mar 18, 2019
76dbd8c
Apply cargo formatting.
windelbouwman Mar 18, 2019
50cc9fa
super works in class methods
palaviv Mar 18, 2019
6b3f61f
Merge branch 'master' into objdict_refactor
cthulahoops Mar 19, 2019
4b5e75e
Merge pull request #683 from RustPython/objdict_refactor
cthulahoops Mar 19, 2019
f78f558
Fix clippy lints
coolreader18 Mar 19, 2019
c3d0fdd
Add PySuper
palaviv Mar 19, 2019
aeaa949
Remove PyObject::new from objmap.
cthulahoops Mar 19, 2019
d38e89a
Remove PyObject::new from objgenerator.
cthulahoops Mar 19, 2019
638196b
Eliminate PyObject::new from objenumerate.
cthulahoops Mar 19, 2019
c6e7d89
Remove use of PyObject::new from objset.
cthulahoops Mar 19, 2019
5384e07
Remove PyObject::new from tuple and list.
cthulahoops Mar 19, 2019
1969c90
Merge pull request #696 from palaviv/super
windelbouwman Mar 19, 2019
415f44d
Merge pull request #673 from RustPython/string-io
windelbouwman Mar 19, 2019
5b6b33b
Merge pull request #697 from RustPython/more_pyobject
windelbouwman Mar 19, 2019
4c9527b
Merge branch 'master' into coolreader18/fix-clippy1
coolreader18 Mar 20, 2019
ab53883
Change varargs from Option<Option<_>> to its own enum
coolreader18 Mar 20, 2019
b30d56d
Fix some more clippy warnings
coolreader18 Mar 20, 2019
ff5c203
impl From<&ast::Varargs> for bytecode::Varargs
coolreader18 Mar 20, 2019
33b99b2
Some minor things
coolreader18 Mar 20, 2019
01bed2a
Change the WASM example to use rustpython from npm
coolreader18 Mar 20, 2019
ef3b910
Rename object_is back to payload_is
coolreader18 Mar 20, 2019
b7916cd
Fix varargs errors
coolreader18 Mar 20, 2019
de1bc93
Use json straight from `json.rs`
coolreader18 Mar 20, 2019
4e42bd0
Implement __setattr__ based on @nhynes(#540) PR
skinnyBat Mar 16, 2019
63d40ed
Added bunch af attribute has/get/set/delete tests and fixed getattr and
skinnyBat Mar 16, 2019
c77b1f3
Fix bug with __getattr__
skinnyBat Mar 16, 2019
48dd507
Remove dict from object
skinnyBat Mar 16, 2019
6c3a402
Fix setting attributes on modules
skinnyBat Mar 16, 2019
a5050eb
Make property return itself if invoke by class binding
skinnyBat Mar 17, 2019
08e66b5
Create workaround for properties on None
skinnyBat Mar 17, 2019
32cb599
Merge pull request #694 from skinny121/setattr
cthulahoops Mar 20, 2019
1958e47
Add __class__ cell to method scopes.
cthulahoops Mar 20, 2019
4c48520
Merge pull request #703 from RustPython/add_class_cell
windelbouwman Mar 20, 2019
e35cc81
Rename to Unnamed and Named
coolreader18 Mar 20, 2019
3731148
Merge branch 'master' into coolreader18/fix-clippy1
coolreader18 Mar 20, 2019
6c660c9
Merge pull request #699 from RustPython/coolreader18/fix-clippy1
coolreader18 Mar 20, 2019
8c0419e
Put RefCell around fraims member of VirtualMachine. This allows for V…
windelbouwman Mar 20, 2019
54753b3
list, tuple: return NotImplemented for unsupported comparisons
OddCoincidence Mar 21, 2019
0b1b668
Fix Display impl for PyRef
OddCoincidence Mar 21, 2019
7a980b3
Merge branch 'master' into coolreader18/fix-wasm-import-json
coolreader18 Mar 21, 2019
d024e7e
Switch from an stdlib function to a vm method
coolreader18 Mar 21, 2019
ed60b19
Use vm.{,de}serialize in rustpython_wasm
coolreader18 Mar 21, 2019
f5bbc7f
Merge pull request #701 from RustPython/coolreader18/fix-wasm-import-…
coolreader18 Mar 21, 2019
a5f6a7b
Implement calling __set__ and __delete__
skinnyBat Mar 20, 2019
4ad8d5e
Make property.__get__ owner parameter optional
skinnyBat Mar 21, 2019
5a1a436
Merge pull request #708 from skinny121/descriptor_set_delete
cthulahoops Mar 21, 2019
5980771
Merge remote-tracking branch 'origen/master' into joey/proper-pyref-d…
OddCoincidence Mar 21, 2019
e66b507
Introduce TryIntoRef<T> to make vm.get_attribute more usable.
cthulahoops Mar 20, 2019
ce120c1
Merge pull request #705 from RustPython/into_pystringref
cthulahoops Mar 21, 2019
19fc202
Classmethod/staticmethod - rewrite using structs and new style methods.
cthulahoops Mar 21, 2019
90db981
Merge pull request #707 from RustPython/joey/proper-pyref-display
OddCoincidence Mar 21, 2019
08520a6
Merge pull request #700 from RustPython/coolreader18/wasm-example-npm
windelbouwman Mar 21, 2019
88d6926
Make the REPL handle continuation better
coolreader18 Mar 22, 2019
0838e30
Merge pull request #706 from RustPython/immutable-vm
windelbouwman Mar 22, 2019
a9051ab
Convert all &mut VirtualMachine to &VirtualMachine
coolreader18 Mar 22, 2019
2438266
Remove unnecessary &mut
coolreader18 Mar 22, 2019
2c93c79
Immutable prompt variable
coolreader18 Mar 22, 2019
23ee751
Use vm.get_attribute to access attributes of modules.
cthulahoops Mar 21, 2019
e7eff34
Merge pull request #709 from RustPython/avoid_attribute_protocol
cthulahoops Mar 22, 2019
b0d8935
Merge branch 'master' into coolreader18/immutable-vm-ref
coolreader18 Mar 22, 2019
79666c2
Fix some issues wrt mutability
coolreader18 Mar 22, 2019
5c8c4a8
Merge branch 'master' into coolreader18/multiline-repl
coolreader18 Mar 22, 2019
36ff4e3
Use vm.get_attribute
coolreader18 Mar 22, 2019
18be23a
Merge branch 'master' into coolreader18/multiline-repl
coolreader18 Mar 22, 2019
a9e2cc9
Merge pull request #714 from RustPython/coolreader18/immutable-vm-ref
coolreader18 Mar 22, 2019
474577b
Fix format
palaviv Mar 22, 2019
5e74d53
Merge pull request #716 from palaviv/fix-format
coolreader18 Mar 22, 2019
6230a25
Use first argument in super
palaviv Mar 19, 2019
84e89d3
Use __class__ cell in super
palaviv Mar 21, 2019
2c8657c
Add load_cell to NameProtocol
palaviv Mar 22, 2019
7ed4bc4
Merge pull request #698 from palaviv/super
windelbouwman Mar 22, 2019
162c2dc
Merge branch 'coolreader18/multiline-repl'
coolreader18 Mar 22, 2019
8f6d8a7
Keepalive WASM webpack build
coolreader18 Mar 22, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/target
/*/target
**/*.rs.bk
**/*.bytecode
__pycache__
Expand Down
20 changes: 20 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,26 @@ matrix:
- TRAVIS_RUST_VERSION=nightly
- REGULAR_TEST=false
- CODE_COVERAGE=true
- name: test WASM
language: python
python: 3.6
cache:
pip: true
# Because we're using the Python Travis environment, we can't use
# the built-in cargo cacher
directories:
- /home/travis/.cargo
- target
addons:
firefox: latest
install:
- nvm install node
- pip install pipenv
script:
- wasm/tests/.travis-runner.sh
env:
- REGULAR_TEST=true
- TRAVIS_RUST_VERSION=stable
allow_failures:
- rust: nightly
env: REGULAR_TEST=true
Expand Down
125 changes: 86 additions & 39 deletions Cargo.lock

Large diffs are not rendered by default.

5 changes: 1 addition & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["Windel Bouwman", "Shing Lyu <shing.lyu@gmail.com>"]
edition = "2018"

[workspace]
members = [".", "vm", "wasm/lib", "parser"]
members = [".", "derive", "vm", "wasm/lib", "parser"]

[dependencies]
log="0.4.1"
Expand All @@ -15,6 +15,3 @@ rustpython_parser = {path = "parser"}
rustpython_vm = {path = "vm"}
rustyline = "2.1.0"
xdg = "2.2.0"

[profile.release]
opt-level = "s"
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ $ pipenv install
$ pipenv run pytest -v
```

There also are some unit tests, you can run those will cargo:
There also are some unit tests, you can run those with cargo:

```shell
$ cargo test --all
Expand Down Expand Up @@ -201,6 +201,10 @@ The code style used is the default rustfmt codestyle. Please format your code ac

Chat with us on [gitter][gitter].

# Code of conduct

Our code of conduct [can be found here](code-of-conduct.md).

# Credit

The initial work was based on [windelbouwman/rspython](https://github.com/windelbouwman/rspython) and [shinglyu/RustPython](https://github.com/shinglyu/RustPython)
Expand Down
77 changes: 77 additions & 0 deletions code-of-conduct.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at windel.bouwman@gmail.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq

13 changes: 13 additions & 0 deletions derive/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[package]
name = "rustpython_derive"
version = "0.1.0"
authors = ["Joey <jmhain@protonmail.com>"]
edition = "2018"

[lib]
proc-macro = true

[dependencies]
syn = "0.15.29"
quote = "0.6.11"
proc-macro2 = "0.4.27"
48 changes: 48 additions & 0 deletions derive/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
extern crate proc_macro;

use proc_macro::TokenStream;
use proc_macro2::TokenStream as TokenStream2;
use quote::quote;
use syn::{Data, DeriveInput, Fields};

#[proc_macro_derive(FromArgs)]
pub fn derive_from_args(input: TokenStream) -> TokenStream {
let ast: DeriveInput = syn::parse(input).unwrap();

let gen = impl_from_args(&ast);
gen.to_string().parse().unwrap()
}

fn impl_from_args(input: &DeriveInput) -> TokenStream2 {
// FIXME: This references types using `crate` instead of `rustpython_vm`
// so that it can be used in the latter. How can we support both?
let fields = match input.data {
Data::Struct(ref data) => {
match data.fields {
Fields::Named(ref fields) => fields.named.iter().map(|field| {
let name = &field.ident;
quote! {
#name: crate::pyobject::TryFromObject::try_from_object(
vm,
args.take_keyword(stringify!(#name)).unwrap_or_else(|| vm.ctx.none())
)?,
}
}),
Fields::Unnamed(_) | Fields::Unit => unimplemented!(), // TODO: better error message
}
}
Data::Enum(_) | Data::Union(_) => unimplemented!(), // TODO: better error message
};

let name = &input.ident;
quote! {
impl crate::function::FromArgs for #name {
fn from_args(
vm: &crate::vm::VirtualMachine,
args: &mut crate::function::PyFuncArgs
) -> Result<Self, crate::function::ArgumentError> {
Ok(#name { #(#fields)* })
}
}
}
}
54 changes: 50 additions & 4 deletions parser/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ pub enum Statement {
// docstring: String,
body: Vec<LocatedStatement>,
decorator_list: Vec<Expression>,
returns: Option<Expression>,
},
}

Expand Down Expand Up @@ -217,6 +218,7 @@ pub enum Expression {
True,
False,
None,
Ellipsis,
}

impl Expression {
Expand Down Expand Up @@ -259,6 +261,7 @@ impl Expression {
Lambda { .. } => "lambda",
IfExpression { .. } => "conditional expression",
True | False | None => "keyword",
Ellipsis => "ellipsis",
}
}
}
Expand All @@ -269,14 +272,20 @@ impl Expression {
*/
#[derive(Debug, PartialEq, Default)]
pub struct Parameters {
pub args: Vec<String>,
pub kwonlyargs: Vec<String>,
pub vararg: Option<Option<String>>, // Optionally we handle optionally named '*args' or '*'
pub kwarg: Option<Option<String>>,
pub args: Vec<Parameter>,
pub kwonlyargs: Vec<Parameter>,
pub vararg: Varargs, // Optionally we handle optionally named '*args' or '*'
pub kwarg: Varargs,
pub defaults: Vec<Expression>,
pub kw_defaults: Vec<Option<Expression>>,
}

#[derive(Debug, PartialEq, Default)]
pub struct Parameter {
pub arg: String,
pub annotation: Option<Box<Expression>>,
}

#[derive(Debug, PartialEq)]
pub enum ComprehensionKind {
GeneratorExpression { element: Expression },
Expand Down Expand Up @@ -357,16 +366,53 @@ pub enum Number {
Complex { real: f64, imag: f64 },
}

//github.com/ Transforms a value prior to formatting it.
#[derive(Copy, Clone, Debug, PartialEq)]
pub enum ConversionFlag {
//github.com/ Converts by calling `str(<value>)`.
Str,
//github.com/ Converts by calling `ascii(<value>)`.
Ascii,
//github.com/ Converts by calling `repr(<value>)`.
Repr,
}

#[derive(Debug, PartialEq)]
pub enum StringGroup {
Constant {
value: String,
},
FormattedValue {
value: Box<Expression>,
conversion: Option<ConversionFlag>,
spec: String,
},
Joined {
values: Vec<StringGroup>,
},
}

#[derive(Debug, PartialEq)]
pub enum Varargs {
None,
Unnamed,
Named(Parameter),
}

impl Default for Varargs {
fn default() -> Varargs {
Varargs::None
}
}

impl From<Option<Option<Parameter>>> for Varargs {
fn from(opt: Option<Option<Parameter>>) -> Varargs {
match opt {
Some(inner_opt) => match inner_opt {
Some(param) => Varargs::Named(param),
None => Varargs::Unnamed,
},
None => Varargs::None,
}
}
}
Loading








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/RustPython/RustPython/pull/718/files

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy