Noa
85ca28094e
Apply clippy suggestions to switch to let chains ( #6126 )
2025-09-04 15:34:10 +09:00
Jack O'Connor and Jack O'Connor
109e64c2ba
Allow multiple indented blocks in REPL ( #6097 )
...
There aren't any tests but being able to do nested for loops seems like
a pretty big win to me so I'm going to put up for review.
The original returned boolean clearly had **false positives** for
detecting bad errors for things like nested `if` and `for` statements.
What is less clear is if there are any **true positives** which I am no
longer catching with the updated return value.
Co-authored-by: Jack O'Connor <jack@jackoconnor.dev >
2025-08-21 13:15:02 +09:00
Shahar Naveh
4bf32a04f4
Apply some clipy lints ( #6045 )
2025-07-30 12:16:02 +09:00
Jeong, YunWon
d40cbbb451
Fix cspell warning ( #5890 )
...
* Fix cspell warning
* cspell: -> spell-checker:
2025-07-03 12:04:43 +09:00
Jeong YunWon
3673372d3d
Fix cspell warnings
2025-06-27 12:32:59 +09:00
Jeong YunWon
2c61a12bed
Apply coderabbit reviews
2025-06-15 16:03:46 +09:00
Jeong YunWon
f560b4cbfb
Fix nightly clippy warnings
2025-06-15 16:03:46 +09:00
Aneesh Durg and Jeong, YunWon
323ea3b96b
Support incomplete parsing ( #5764 )
...
* continue accepting REPL input for multiline strings
* Match cpython behavior for all multi-line statements (execute when complete)
* Emit _IncompleteInputError when compiling with incomplete flag
* Refine when _IncompleteInputError is emitted
* Support multiline strings emitting _IncompleteInputError
* lint
* Undo accidental change to PyTabError
* match -> if let
* Fix test_baseexception and test_codeop
* fix spelling
* fix exception name
* Skip pickle test of _IncompleteInputError
* Use py3.15's codeop implementation
* Update Lib/test/test_baseexception.py
---------
Co-authored-by: Jeong, YunWon <69878+youknowone@users.noreply.github.com >
2025-06-05 14:41:56 +09:00
Aneesh Durg
e49e743669
Support multiline function/class definitions in REPL and InteractiveConsole ( #5743 )
...
* Support multiline function/class definitions in REPL and InteractiveConsole
2025-04-30 14:53:37 +09:00
Jeong YunWon
e434ff5f6e
basic wasip2 support
2025-04-20 19:47:35 +09:00
Jeong, YunWon
4ae2936a45
fix more cspell warnings ( #5689 )
2025-04-11 12:08:07 +09:00
Jeong YunWon
36cce6b174
run fmt
2025-04-05 00:14:03 +09:00
Ashwin Naren
5c854fc690
clear out warnings
2025-04-04 21:46:28 +09:00
Jeong YunWon
d7113e11db
Fix more cspell warnings
2025-04-04 21:45:03 +09:00
Jeong YunWon
7ac61f3840
fix cspell warnings
2025-04-04 16:15:54 +09:00
Jeong, YunWon
c7ca173c90
Merge pull request #5254 from youknowone/exception-group
...
ExceptionGroup
2025-03-27 14:51:12 +09:00
Jeong YunWon
e7fdfca5f5
Add python-implemented ExceptionGroup
2025-03-27 01:28:36 +09:00
Jeong YunWon
bc38e9dedd
Apply nightly clippy suggestions
2025-03-26 14:52:23 +09:00
Noa
950a8d5694
Update to ruff_python_parser 0.11
2025-03-19 22:45:57 -05:00
a6b4ef7f5d
Replace Python parser with ruff parser ( #5494 )
...
* stage1
* compiler pass build
* introduce rustpython-compiler-source
* stage2
* fixup
* pass compile
* Fix hello world compiler test
* Fix code generation for if-elif-else statement
* Fix code generation for lambda expression
* Fix code generation for integers
* Fix code generation for fstrings
* Fix code generation for if statement
* Fix code generation for if statement
* Fix code generation for if statement
* Fix code generation for fstring
* Fix code generation for class definition
* Replace feature flags
* Initialize frozen core modules
* Allow __future__ import after module doc comment
* Disable ast module
* Commit remaining fixes for compile errors in examples
* Fix some warnings
* Update ast stdlib module
* Update ast stdlib module
* Update ast stdlib module
* Update ast stdlib module
* Update ast stdlib module
* Split ast stdlib module into files
* Fix codegen for positional arguments with defaults
* Update ast stdlib module
* Update ast stdlib module
* Extract string and constant handling from expression.rs
* Always add required fields to AST nodes
* Compile doc strings correctly again
* Enable "ast" Cargo feature by default
* Refactor compilation of big integer literal
* Update ast stdlib module
* Update ast stdlib module
* Update ast stdlib module
* Reset barebones example
* Fix some left-over warnings
* Undo accidential change
* Adapt shell to ruff parser
* Pin parser to v0.4.10
* fix clippy
* Add TODO about interactive mode
* Fix compilation of complex number expression
* Remove moved code
* Update test case to ruff v0.4.10
* Apply suggestion
Co-authored-by: Jeong, YunWon <69878+youknowone@users.noreply.github.com >
* Apply suggestion
Co-authored-by: Jeong, YunWon <69878+youknowone@users.noreply.github.com >
* Fix compilation of fstring expression
* Fix compilation of fstring expression
* Fix wasm compile errors
* Attach correct source locations to ast objects
* Fix some more wasm compile errors
* Consider compile mode and enable AST stdlib module again
* Fix incorrect AST source location end column
* Fix compile error if "compiler" feature is not enabled
* Fix regrtests
* Fix some test_ast tests
* Add source range to type ignore
* Fix incompatibility with Rust 2024 edition
* Fix todos by implementing missing ast conversions and deleting unused code
* Appease clippy
* Fix remaining ast tests
* Fix remaining ast tests
* Mark/fix remaining tests
* Fix more
* Hacky windows fix
---------
Co-authored-by: Kangzhi Shi <shikangzhi@gmail.com >
Co-authored-by: Jeong YunWon <jeong@youknowone.org >
Co-authored-by: Jeong, YunWon <69878+youknowone@users.noreply.github.com >
Co-authored-by: Noa <coolreader18@gmail.com >
2025-03-19 21:06:03 -05:00
Noa
a596568151
Use lexopt for argument parsing ( #5602 )
2025-03-19 12:28:58 -05:00
Ashwin Naren
b870b0e1b5
2024 edition formatting
...
Signed-off-by: Ashwin Naren <arihant2math@gmail.com >
2025-02-26 11:48:22 -08:00
Noa
0a8b0406f5
Enable missing_unsafe_on_extern lint
2025-02-24 21:25:23 -06:00
Noa
a9331bb34d
Fix warnings for rust 1.85
2025-02-20 14:58:59 -06:00
Noa
b7db23bbae
Fix warnings for Rust 1.84
2025-01-11 18:48:27 +09:00
carsonzhu
01f7536b36
expose run_shell
2024-12-11 17:33:36 +09:00
Noa
e4be882994
Miscellaneous cli-related parity fixes
2024-12-03 16:28:32 -06:00
Jeong, YunWon
b1a38c2d50
Fix rust 1.80 warnings ( #5363 )
...
* Fix rust 1.80 warnings
* Fix nightly clippy warnings
2024-07-28 10:43:40 +09:00
Jeong YunWon
87849cda4f
fix grammar
2024-04-30 23:18:14 +09:00
Jeong YunWon
24f57dde2f
Align Settings to PyConfig
2024-04-30 23:18:14 +09:00
Jeong YunWon
6b7b080827
Add sys._stdlib_dir when freeze-stdlib
2024-04-30 22:21:56 +09:00
Jeong YunWon
f0f4633346
Fix nightly clippy
2024-04-18 03:37:29 +09:00
Jeong, YunWon
6eed8f42c7
split vm.import and vm.import_from ( #5212 )
2024-04-08 00:07:38 +09:00
Jeong, YunWon
3737f2a091
make adding a single module simpler for interpreter users ( #4792 )
2024-03-21 21:48:29 +09:00
Jeong, YunWon
4135da42ac
Fix clippy ( #5083 )
...
* Fix clippy
* Fix nightly clippy
2023-10-06 03:17:03 +09:00
Dominic Elm
c25aa1add4
Print version and info text when executing the shell ( #5057 )
2023-08-31 17:46:00 +09:00
Jeong, YunWon and fanninpm
64c66e00d6
Fix encodings related error messages to be less confusing ( #5049 )
...
* Move cwd setup to interpreter code
* rework import encodings failure message
* try import_encodings only when `path_list` is set
* std::mem::take instead of drain(..).collect()
* Add empty path_list warnings to import_encodings
* Prepend current working directory when !safe_path
Co-authored-by: fanninpm <fanninpm@miamioh.edu >
2023-08-30 21:45:36 +09:00
Jeong, YunWon and fanninpm
4ba2892168
Better tips for Interpreter & InterpreterConfig ( #5047 )
...
Co-authored-by: fanninpm <fanninpm@miamioh.edu >
2023-08-30 20:00:07 +09:00
Junho Lee and Jeong YunWon
d4be55c2ea
Add command line parameter -P ( #4611 )
...
* Add command line parameter -P
* Modify the value of safe_path to be set
---------
Co-authored-by: Jeong YunWon <jeong@youknowone.org >
2023-08-30 19:32:27 +09:00
Dominic Elm
3131d56298
fixup: add note
2023-08-27 02:30:07 +09:00
Dominic Elm
9c2355117c
Add ability to initialize cwd from PWD when targeting WASI
2023-08-27 02:30:07 +09:00
Jeong, YunWon
d4d362a9ca
Update to Rust 1.72.0
2023-08-27 00:38:10 +09:00
Bobby Palmer
a58ede99f2
add int_max_str_digits input from command line ( #5021 )
...
* added int_max_str_digits to settings struct
* changed vm init to use the value from settings
* added error handling and set the settings default to -1 which sets the value to 4300
2023-07-06 01:24:11 +09:00
Jeong YunWon
f1b261b4f8
Adapt byte-offset location
2023-05-10 04:13:30 +09:00
Jeong YunWon
bac1cdc55f
Remove compiler_core::CompileError
2023-05-06 18:22:25 +09:00
Jeong YunWon
19224505e8
module objects' type as PyModule
2023-04-20 20:48:57 +09:00
Jeong, YunWon
11aefa3e42
Merge pull request #4735 from youknowone/try_from_borrowed_object
...
apply TryFromBorrowed more
2023-03-27 15:11:57 +09:00
Jeong YunWon
494c7bda58
method calls to take &PyObject
2023-03-22 22:09:14 +09:00
Jeong YunWon
b08f415f80
remove useless refcount
2023-03-22 02:38:18 +09:00
Jeong YunWon
ab1de2942c
type.__name__ & getattr optimization
2023-03-20 19:00:01 +09:00