14060 Commits

Author SHA1 Message Date
Daniel Watkins
0c097f011e Merge pull request #45 from OddBloke/dict
Implement no-arg dict builtin and len() for dicts
2018-08-07 21:26:56 -04:00
Daniel Watkins
78447bb4f4 Implement no-arg dict builtin 2018-08-07 20:23:58 -04:00
Daniel Watkins
99ccc97907 Implement len() for dicts 2018-08-07 20:22:17 -04:00
Daniel Watkins
da55a6addb Refactor shared list/tuple functions to objsequence.rs 2018-08-06 15:08:45 -04:00
Daniel Watkins
5dad8b2c54 Remove duplicated get_pos function on objtuple 2018-08-06 15:03:45 -04:00
Daniel Watkins
dbd65071fe Implement stepped slicing for tuples 2018-08-06 15:02:43 -04:00
Daniel Watkins
a0844f1f39 Refactor list slicing out to separate function 2018-08-06 10:56:52 -04:00
Windel Bouwman
a40ef57ba4 Merge pull request #41 from OddBloke/function_args
Allow Tests in function arguments (rather than just Expressions)
2018-08-06 16:48:35 +02:00
Windel Bouwman
45d3d74776 Merge pull request #40 from OddBloke/slice
Implement (positive) stepped slicing for lists
2018-08-06 16:48:04 +02:00
Windel Bouwman
3575b2785c Merge pull request #43 from OddBloke/tuple_comparison
Enable tuple comparison
2018-08-06 16:46:19 +02:00
Windel Bouwman
19d06c4099 Merge pull request #42 from OddBloke/single_element_tuples
Single element tuples
2018-08-06 16:45:07 +02:00
Daniel Watkins
de70b8b881 Another couple of trivial warning fixes 2018-08-05 23:04:18 -04:00
Daniel Watkins
cca039b337 Add tuple comparison test to tuple snippet test 2018-08-05 16:55:07 -04:00
Daniel Watkins
15d4664477 Enable tuple comparison
Tuples and lists have the same internal representation, so we can just
reuse the existing list comparison logic.

This fixes #38.
2018-08-05 16:52:21 -04:00
Daniel Watkins
d5ce48535d Format single-element tuple string representations correctly
(i.e. with a trailing comma within the parentheses)
2018-08-05 16:47:44 -04:00
Daniel Watkins
36f6fb2733 Support creation of single-element tuples
This fixes #37
2018-08-05 16:41:20 -04:00
Daniel Watkins
c8a0b04b2d Allow Tests in function arguments (rather than just Expressions)
This fixes #39
2018-08-05 16:24:32 -04:00
Daniel Watkins
8a0b75d591 Implement (positive) stepped slicing for lists 2018-08-05 15:48:08 -04:00
Daniel Watkins
5b17ccb4f4 Merge pull request #36 from RustPython/fix_warnings
Fix some warnings
2018-08-05 15:06:59 -04:00
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
4f13e3db9c Merge pull request #35 from yodalee/fizzbuzz
Fizzbuzz
2018-08-05 12:26:07 -04:00
yodalee
8b4549efbe Add fizzbuzz snippet to tests 2018-08-05 10:32:25 -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
Adam Kelly
5714cf14cf Interpreter - read until empty line after first continuation. 2018-08-05 10:08:32 +01: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
fcf3518f4a Merge pull request #30 from OddBloke/nums_in_funcs
Include numbers in valid identifier characters
2018-08-04 23:01:01 +02:00
Windel Bouwman
7b599d4a8d Merge pull request #31 from OddBloke/basic_range
Naive builtin range function
2018-08-04 22:59:22 +02:00
Windel Bouwman
f66a330b13 Merge pull request #26 from cthulahoops/interpreter_improvements
Interpreter improvements
2018-08-04 22:57:21 +02:00
Daniel Watkins
2a52a15fa6 Restore perf_fib to being tested
We now have a range function that is sufficient for its purposes.
2018-08-04 16:26:06 -04: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
Daniel Watkins
3e56bc1d60 Include numbers in valid identifier characters
Fixes #27.
2018-08-04 16:00:15 -04:00
Adam Kelly
c6ef62ceac Improved interpreter using compile single and with multiline input. 2018-08-04 20:47:34 +01: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
Adam Kelly
a9afa76438 Test that an empty line parses. 2018-08-04 20:47:34 +01:00
Windel Bouwman
4bbff56d0e Merge pull request #29 from RustPython/tests
Run snippet tests in Travis
2018-08-04 20:26:47 +02:00
Daniel Watkins
dc633ef818 Comment or move all currently-failing snippet tests
This allows us to make the snippet tests merge-blockers, whilst
improving over time.
2018-08-04 13:55:23 -04:00
Daniel Watkins
a9d6c8db87 Run snippet tests for stable and beta Rusts 2018-08-04 13:43:30 -04:00
Daniel Watkins
9e8c5fb960 First attempt to run snippet tests in Travis 2018-08-04 13:37:52 -04:00
Daniel Watkins
c857d75748 Restore running of benchmarks in test_snippets.py
This distinguishes them from regular snippet tests, and runs them
without trace logging (which was causing major slowdowns previously).
2018-08-04 12:51:12 -04:00
Daniel Watkins
402ca31423 Suppress cargo/jobserver log messages in snippet testing
They make the output unmanageably large, and don't provide any useful
information for debugging.
2018-08-04 12:51:12 -04:00
Daniel Watkins
31bdfe2cd7 Move performance snippets to a separate directory 2018-08-04 12:51:12 -04:00
Windel Bouwman
9f0360947a Use boolean short circuit in expression logic 2018-08-04 18:14:33 +02:00