Commit Graph
98 Commits
Author SHA1 Message Date
Noa c6cab4c43a Parse surrogates in string literals properly 2025-03-26 22:44:42 -05: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 6daee1b00e Warn on elided_lifetimes_in_paths 2025-03-01 13:49:33 +09:00
Ashwin Naren b870b0e1b5 2024 edition formatting
Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2025-02-26 11:48:22 -08:00
Noa 864e8598f8 Enable rust2024-incompatible pat and keyword-ident lints 2025-02-25 00:32:02 -06:00
Ashwin Naren e8a3406624 itertools upgrade 2025-02-16 10:20:56 +09:00
Ashwin Naren a46ce8ec3a Mark version 3.13.0 (#5495)
* bump to 3.13.1
* fix some tests
* strip left whitespace from doc
* remove specific difflib test that was causing issues
* fix test_enum

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2025-02-13 14:11:01 +09:00
Lee Dogeon 465627f104 Implement vm logics related with ParamSpec, TypeVarTuple 2025-02-10 21:21:38 +09:00
Ashwin Naren 396a0ca563 Basic Match statements (#5485)
Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2025-01-25 23:14:15 +09:00
Jeong YunWon 7d770f55fb more assertions in switch_to_block 2025-01-21 23:53:23 +09:00
Noa b7db23bbae Fix warnings for Rust 1.84 2025-01-11 18:48:27 +09:00
Jeong YunWon 2919df1df5 Mark rust-version 1.78 2024-08-08 23:20:17 +09:00
Jeong YunWon 8673169ee7 0.4.0 2024-08-07 08:38:21 +09:00
James Clarke 08c9a4d86b Added lints and deny.toml 2024-06-25 03:59:40 +01:00
Jonathan Rotter 7996a10116 await in list comprehension (#5334)
* check if comprehension element contains await

* force execution to pause in async gen
2024-05-27 16:54:56 +09:00
matheusfgoncalves95 515f0bf9c2 Adding generator_stop to compile_future_features (#5320)
* Adding generator_stop to compile_future_features.

* Removing expected failure from PEP 479 unit test.
2024-05-13 23:18:55 +09:00
Daniel Chiquito ac08f4447f Add 3.12 typing features to the compiler (#5302) 2024-05-10 20:09:04 +09:00
Jeong YunWon 019496e3a8 Instruction::ReturnConst 2024-05-09 15:26:16 +09:00
Jeong YunWon f3501f44cb Basic async for comprehension support 2024-04-25 20:23:25 +09:00
HyeockJinKim 61f37b10e2 implement async for function in compiler 2024-04-25 20:20:58 +09:00
Aaron Long 2856aff757 Begin async list comprehension implementation 2024-04-25 20:20:22 +09:00
hydrogen602 af8bed6d3f filter out doc strings with opt level 2 2024-04-25 16:11:04 +09:00
Jeong YunWon 75e790836a debuggable 2024-04-24 20:44:17 +09:00
Jeong YunWon 075c69a3cd Skip setattr(__doc__) if not given 2024-04-23 22:44:22 +09:00
Jeong YunWon 8816cd41d5 0.3.1 2024-04-10 17:39:57 +09:00
rrupy 2f8e5189d3 Use ast::Suite::parse instead of deprecated parse_program. (#5186) 2024-03-05 22:37:42 +09:00
Jeong YunWon d26766b7bc better symboltable error message 2024-02-29 21:30:31 +09:00
Jeong YunWon 506c8a633e Fix redox and nightly 2023-12-30 12:53:57 +09:00
Jeong YunWon a309cb5d2c Fix 1.75 clippy warnings 2023-12-30 11:48:40 +09:00
Jeong, YunWon 4135da42ac Fix clippy (#5083)
* Fix clippy

* Fix nightly clippy
2023-10-06 03:17:03 +09:00
Jeong YunWon 1208416b92 0.3.0 release 2023-09-06 18:49:55 +09:00
Jeong, YunWon d4d362a9ca Update to Rust 1.72.0 2023-08-27 00:38:10 +09:00
Zanie Blue bdb0c8f645 Add parser support for PEP 695 (#5026)
* Add generated content for PEP 695 ASDL

* Bump RustPython/Parser to https://github.com/RustPython/Parser/commit/704eb40108239a8faf9bd1d4217e8dad0ac7edb3

* Add stubs for type aliases and parameters
2023-07-20 13:54:07 +09:00
Jeong, YunWon 3d2c51962b Update parser (#5012) 2023-06-18 02:38:42 +09:00
Steve Shi de0d323ad3 change dependency from num-bigint to malachite-bigint (#4952) 2023-06-08 14:28:39 +09:00
Jeong, YunWon 7a3f965396 new ast layout for arguments (#4978) 2023-06-02 17:07:34 +09:00
Jeong, YunWon ff7055749c Update parser to specialize ConversionFlag (#4976) 2023-05-17 10:47:56 +09:00
Jeong, YunWon f5fc30ae63 Move range to each Node (#4969) 2023-05-15 17:00:23 +09:00
Micha Reiser 7a6000d181 Use format and cformat from rustpython-literal (#4968)
* Use `format` and `cformat` from `rustpython-literal`

* Remove unused dependencies, use `rustpython-format`
2023-05-13 02:58:02 +09:00
Jeong YunWon a43a8c546e Revert a few .as_str() calls by adding it to ast 2023-05-11 04:43:57 +09:00
Jeong YunWon 4064c84cb4 ast::Identifier and ast::Int 2023-05-10 20:31:35 +09:00
Jeong YunWon dc569e9921 Refactoring 2023-05-10 19:35:27 +09:00
Jeong YunWon f1b261b4f8 Adapt byte-offset location 2023-05-10 04:13:30 +09:00
Jeong YunWon c7025f70d5 Remove PySymbol*Ref types 2023-05-08 01:11:13 +09:00
Jeong YunWon 0af106c85c Refactor ast to hold data as seperated type 2023-05-07 19:31:31 +09:00
Jeong YunWon ff808ad313 more location -> start() 2023-05-06 19:59:03 +09:00
Jeong YunWon f2cfa5f0a7 Split parser to new repository
https://github.com/RustPython/Parser/commit/6b60f85cc4ca248af9b787697c41be2adb7a3ec8
2023-05-06 14:38:11 +09:00
Jeong YunWon 12c96d06e4 Remove useless and_then 2023-03-18 22:10:25 +09:00
Jeong YunWon 21afc1933a Update cspell for compiler 2023-03-16 22:39:09 +09:00