Commit Graph

7723 Commits

Author SHA1 Message Date
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
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
Windel Bouwman
1d08e1bf57 Merge pull request #25 from OddBloke/fix_while_break
Emit a SetupLoop instruction during while loop compilation
2018-08-04 10:06:14 +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
46257724e7 Add tests to snippet for stepped string slicing 2018-08-04 00:41:31 -04:00
Daniel Watkins
705c1c7dee Implement stepped slicing for strings 2018-08-03 20:56:47 -04:00
Daniel Watkins
862442b635 Simplify the conversion of missing slice parts to None 2018-08-03 20:55:18 -04:00
Daniel Watkins
73b2d07578 Support parsing steps in slice syntax 2018-08-03 20:55:18 -04:00
Windel Bouwman
e1ce670d4b Merge pull request #22 from OddBloke/locals_trace
Output locals mapping in trace logging
2018-08-03 17:23:47 +02: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
Windel Bouwman
4b2f86dbf2 Merge pull request #19 from OddBloke/dash_c
Enable semi-colon separated statements
2018-08-01 17:45:55 +02:00
Windel Bouwman
97c5ec1105 Merge pull request #20 from OddBloke/workspace
Make repo a workspace and run tests for all components in Travis
2018-08-01 17:44:44 +02:00
Windel Bouwman
6deafa1d28 Merge pull request #21 from OddBloke/import_with_builtins
Use a scope (with builtins) for module import
2018-08-01 17:41:28 +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
Daniel Watkins
02acfd91fc Make repo a workspace and run tests for all components in Travis 2018-07-31 16:43:24 -04:00
Daniel Watkins
43fafa5102 Enable semi-colon separated statements
For example, `cargo run -- -c 'print("a"); print("b")'`.
2018-07-31 16:33:27 -04:00
Windel Bouwman
03bda855e7 Clean test code 2018-07-31 22:11:40 +02:00
Windel Bouwman
188798ac2b Merge pull request #18 from OddBloke/dash_c
Add a -c option to main.rs
2018-07-31 21:46:20 +02:00
Daniel Watkins
ca842d0813 Add -c option to main.rs
This option takes a string which it runs as a program.
2018-07-31 14:35:14 -04:00
Daniel Watkins
d50d920866 Refactor script running to separate method 2018-07-31 14:22:45 -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
Windel Bouwman
099595bf17 Merge pull request #15 from wulmer/feature/windows-and-mac-eol-characters
Add support for Windows/Mac EOL characters in lexer
2018-07-29 17:15:49 +02:00
Nyiro Gergo
77e80bc42c vm/import: add module name to message of NotFound error 2018-07-29 10:43:10 +02:00
Adam Kelly
69dd261fe4 Merge branch 'warnings_cleanup' 2018-07-29 09:26:10 +01:00
Adam Kelly
e79ec8e4cb Suppress unused variable warnings. 2018-07-29 09:06:56 +01:00