Commit Graph

7723 Commits

Author SHA1 Message Date
Windel Bouwman
c9816c37de Fix append snippet 2018-08-14 22:44:55 +02:00
Windel Bouwman
919b7f631d Add reverse function to list 2018-08-14 22:01:40 +02:00
Windel Bouwman
34bba7a257 Borrow list object mutably and append item 2018-08-14 21:52:00 +02:00
Windel Bouwman
4ada085234 Format code properly and try to implement append function 2018-08-14 21:21:47 +02:00
Windel Bouwman
51acd6c4b5 Register append function to list type 2018-08-14 20:56:14 +02:00
Daniel Watkins
573edffafc Merge pull request #60 from RustPython/none
There is only one none.
2018-08-12 17:12:52 -04:00
Adam Kelly
c83f548d92 There is only one none. 2018-08-12 20:20:56 +01:00
cthulahoops
1ad9f87f4e Merge pull request #59 from RustPython/methods
Methods
2018-08-12 19:34:39 +01:00
Adam Kelly
3a6649ddeb Use standard method machinary to call __init__. 2018-08-12 18:57:56 +01:00
Adam Kelly
4b52f72316 load_attr to use class based attribute getting. 2018-08-12 18:57:56 +01:00
Adam Kelly
0597cff6c6 Add has_attr to AttributeProtocol. 2018-08-12 18:27:03 +01:00
Adam Kelly
6889b34515 Add Type Protocol. 2018-08-12 18:27:03 +01:00
Adam Kelly
43011d3a9c Create functions with type of function class. 2018-08-12 18:27:03 +01:00
Adam Kelly
cb3bd23cb1 Add modules for class and function objects. 2018-08-12 18:27:03 +01:00
Adam Kelly
9776385ce9 Ignore vim swap files. 2018-08-12 18:26:41 +01:00
Windel Bouwman
1f8595cc94 Merge pull request #58 from OddBloke/trailing_commas
Parse trailing commas in lists/dicts
2018-08-12 12:20:00 +02:00
Daniel Watkins
19c9db2375 Parse trailing commas in lists/dicts 2018-08-11 23:37:01 -04:00
Windel Bouwman
37c1377fcb Merge pull request #57 from OddBloke/rustfmt
Format the whole project (and add Travis check to avoid regression)
2018-08-11 10:09:45 +02:00
Daniel Watkins
aa41eb7cd1 Add rustfmt check to Travis 2018-08-10 20:36:44 -04:00
Daniel Watkins
2a90df80c8 Run cargo fmt to format the entire project 2018-08-10 20:23:15 -04:00
Daniel Watkins
a9653931b7 Fix warnings emitted during cargo test 2018-08-10 17:13:27 -04:00
Daniel Watkins
76a19d35be Move lexer::lex_source in to tests module
That's the only place it is used; this fixes a warning.
2018-08-10 17:10:42 -04:00
cthulahoops
8bda921856 Merge pull request #56 from OddBloke/warnings
Fix all current warnings
2018-08-10 22:02:32 +01:00
Daniel Watkins
0b5248827b Allow TryExcept to be dead code (for now)
TryExcept is referenced by code, so I don't want to rename it, but it's
never constructed so it still produces a warning.
2018-08-10 16:32:11 -04:00
Daniel Watkins
ede4533349 Rename objdict::_set_item as it is unused 2018-08-10 16:32:11 -04:00
Daniel Watkins
f879fd9b43 Rename objlist::append as it is unused 2018-08-10 16:32:11 -04:00
Daniel Watkins
a15007f10d Remove the unused and empy objint::add function 2018-08-10 16:32:11 -04:00
Daniel Watkins
340d90a3f9 Refactor push_code_object to push_new_code_object
The argument wasn't being used by the current implementation, so drop
it.
2018-08-10 16:32:11 -04:00
Daniel Watkins
d8d9eb8087 Silence a variety of unused argument warnings 2018-08-10 16:32:11 -04:00
Daniel Watkins
20737f77ac Remove duplicated match arm from PyObject::eq 2018-08-10 16:32:11 -04:00
Daniel Watkins
d8cd5a3361 Enforce zero arguments to locals 2018-08-10 16:31:13 -04:00
Daniel Watkins
976a3f7a03 Remove unused VirtualMachine.call function 2018-08-10 12:34:01 -04:00
Daniel Watkins
aba1daf674 Remove unused import (and rustfmt all imports) in vm.rs 2018-08-10 12:32:53 -04:00
Daniel Watkins
47c9a9c66a Remove unused import 2018-08-10 10:09:37 -04:00
Windel Bouwman
816038c166 Merge pull request #54 from OddBloke/import
Implement complex import handling
2018-08-10 15:40:28 +02:00
Windel Bouwman
a7f1830fe7 Merge pull request #50 from OddBloke/triple_quotes
Implement triple-quotes for strings
2018-08-10 15:36:24 +02:00
Daniel Watkins
a7428e3808 Implement complex import handling
This expands import parsing and handling to implement a variety of
import cases:

* `import x as y`
* `import x, y`
* `from x import y`
* `from x import y, z`
* `from x import y as z, a as b`

This fixes #51.
2018-08-09 17:14:08 -04:00
Daniel Watkins
c9738a0cd1 Ensure snippet tests can import other snippets 2018-08-09 17:14:08 -04:00
Adam Kelly
2e165efbb6 Propagate exceptions raised in init. 2018-08-09 18:56:38 +01:00
Daniel Watkins
3e07540afc Remove unused "use" from objstr 2018-08-09 11:19:37 -04:00
Daniel Watkins
24848a99f9 Merge pull request #52 from cthulahoops/classes
Classes
2018-08-09 10:06:46 -04:00
Adam Kelly
339189aff4 Remove special Type type. Type is just a class. 2018-08-09 08:58:36 +01:00
Adam Kelly
aa1207adcf Snippet to test out class definition. 2018-08-09 07:55:52 +01:00
Adam Kelly
9df841b38b Set and retrieve attributes on instances. 2018-08-09 07:55:52 +01:00
Adam Kelly
13313e44e8 Add support creating instances of objects. 2018-08-09 07:55:52 +01:00
Adam Kelly
ccfbe6c4ff Ability to define classes. 2018-08-09 07:51:26 +01:00
Adam Kelly
402230684f Add support for parsing classes to ast. 2018-08-09 07:41:33 +01:00
Daniel Watkins
3861fd898e Implement triple-quotes for strings
This fixes #33.
2018-08-08 23:36:32 -04:00
Windel Bouwman
dc5563916b Merge pull request #49 from OddBloke/str_seq
Unify string and sequence slicing operations
2018-08-08 21:22:20 +02:00
Daniel Watkins
98883b7266 Move more slice functions in to PySliceableSequence 2018-08-08 12:44:51 -04:00