Commit Graph
22 Commits
Author SHA1 Message Date
Jeong, YunWonandCPython Developers 6b870d62ad Fix traceback, syntax errors, and exception handling (#7015)
* Update codeop from v3.14.3

* Fix traceback, syntax errors, and exception handling

- Improve unclosed bracket detection with "'(' was never closed" message
- Fix IndentationError location to point to end of line
- Implement frame.clear() with proper checks for executing/suspended frames
- Fix exception context chaining for propagated exceptions
- Add traceback.__dir__() and prevent tb_next deletion
- Fix subscript operation source range restoration in compiler
- Change "duplicate parameter" to "duplicate argument" error message
- Refactor duplicate code in asyncgenerator.rs and frame.rs

---------

Co-authored-by: CPython Developers <>
2026-02-07 13:41:45 +09:00
Jeong, YunWon 522793850a mark and unmark unittest functions 2026-01-17 19:21:38 +09:00
ShaharNaveh 6a4d4b727c Uodate test_grammar.py from 3.13.7 2025-08-31 11:47:32 +03:00
Jeong YunWon 481e03abe4 Replace old anndata to new from CPython 3.13.5 2025-07-07 21:18:48 +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
Jeong YunWon f6d88042b5 Uncomment test_grammar tests 2024-04-25 20:23:34 +09:00
kth496andHyeonji-Ryu 203d1998e2 Fix multiline lexer bug
Co-authored-by: Hyeonji-Ryu <cjstk3940@naver.com>
2022-07-13 17:02:17 +09:00
Dean Li 29c953d9a6 test: update test.support and test_io to 3.10
Initially this is only meant to be a small update for `test_io.py`.
But it turns out that `test.support` need a lot of cleanup especially
for `test.support.warnings_helper`.
2022-04-18 22:50:55 +08:00
Jeong YunWon 7bcf2c3e39 Merge pull request #3014 from leesungbin/underscore_grammar
Solve some lexical error with underscore
2021-10-19 08:37:03 +09:00
Noa 4087fa1d6e Unmark passing tests 2021-10-17 21:55:34 -05:00
이성빈 d7e9c7d39e raise syntax error when '_' after 'e' or 'E' 2021-09-05 21:02:50 +09:00
Padraic Fanning 71a4934bc1 Unmark passing test in test_grammar 2021-08-28 12:03:33 -04:00
Noah d940e17bf1 Implement name mangling 2021-01-26 09:59:16 -06:00
Noah 5bbe2da1ef Merge pull request #2350 from isidentical/issue-2349
Handle raw yield expressions as RHS for augmented/annotated assignments
2020-12-06 11:12:04 -06:00
Noah 7c58f4a0c8 Fast locals part 3 2020-12-05 16:36:35 -06:00
Batuhan Taskaya f2ba4124ba Remove expected failure from test_var_annot_rhs 2020-11-30 18:09:45 +03:00
Jeong YunWon c37c1bbf93 unskip test_grammar.py 2020-11-12 11:30:33 +09:00
minoring b8cb2dfa2b Uncomment test_nonlocal 2020-09-05 22:42:52 +09:00
Yiqun Ling 6b361bb409 Set annotation for function args 2020-07-14 18:58:58 +09:00
Jeong YunWon b4f0ced701 disable failing tests from test_grammar.py 2020-03-08 00:13:13 +09:00
CPython dev c2b8e92da4 Lib/test/test_grammar.py from CPython 3.8.1 2020-03-08 00:13:13 +09:00