Commit graph

364 commits

Author SHA1 Message Date
Harsha Teja Kanna
a367239af1
Fix the invalid license name for cargo-deny (#110) 2023-12-28 00:59:03 +09:00
Steve Shi
52edf4525e
Merge pull request #103 from qingshi163/malachite041
Bump malachite to 0.4.4
2023-11-07 19:34:31 +02:00
Kangzhi Shi
82e1d95cfb Bump malachite to 0.4.4 2023-11-05 06:47:14 +02:00
Kangzhi Shi
28eff35cee Bump malachite to 0.4.1 2023-11-01 22:03:23 +02:00
Jeong, YunWon
13cae0af64
Clean up Cargo.toml and bump dependency versions (#104)
* Update PyO3

* replace unicode_names2 to official release

* clean up Cargo.toml and bump dependency versions
2023-10-03 20:50:52 +09:00
Jeong, YunWon
a1e4336f70
0.3.0 (#92) 2023-08-30 00:04:44 +09:00
Jeong, YunWon
d09bce80e6
vendor text_size and source_location (#102) 2023-08-29 19:52:25 +09:00
Zanie Blue
b07966695a
Fix TypeAliasName to store name instead of load (#99)
* Fix `TypeAliasName` to store name instead of load

* Update snapshot tests
2023-07-29 14:23:49 +09:00
Zanie Blue
704eb40108
Add parsing of type alias statements i.e. the type keyword (#97)
Extends #95
Closes #82 

Adds parsing of new `type` soft keyword for defining type aliases.

Supports type alias statements as defined in PEP 695 e.g. 

```python
# A non-generic type alias
type IntOrStr = int | str

# A generic type alias
type ListOrSet[T] = list[T] | set[T]

# A type alias that includes a forward reference
type AnimalOrVegetable = Animal | "Vegetable"

# A generic self-referential type alias
type RecursiveList[T] = T | list[RecursiveList[T]]
```

All type parameter kinds are supported as in #95.

Builds on soft keyword abstractions introduced in https://github.com/RustPython/RustPython/pull/4519
2023-07-17 11:00:08 -04:00
Zanie Blue
6980037ad9
Parse type parameters in function definitions (#96)
* Parse type parameters in function definitions
* Add test for combined items
2023-07-15 06:51:32 +09:00
Micha Reiser
c33fbeef54
Parse type parameters in class definitions 2023-07-14 17:15:30 +02:00
Zanie
3ec64e124a Consolidate tests and add coverage for trailing comma 2023-07-13 08:51:23 -05:00
Zanie
e0a8f5b7b3 Add bound to test case test_parse_class_with_all_possible_generic_types 2023-07-13 08:40:24 -05:00
Zanie
b06b2662c9 Add test for tuple bounds 2023-07-13 08:40:24 -05:00
Zanie
76a3245479 Remove test for empty generic class Foo[]: ...
Not valid syntax
2023-07-13 08:40:24 -05:00
Zanie
d923aa92bb Parse type parameters in class definitions 2023-07-13 08:40:24 -05:00
Micha Reiser
c8092b20a2
Update to the latest ASDL
Update to the latest ASDL
2023-07-13 10:41:50 +02:00
Zanie
7516c4248c Move type_param stubs into LALRPOP definition 2023-07-11 09:42:45 -05:00
Zanie
3617a6c52b Bump size assertion for Stmt from 136 to 160 bytes 2023-07-10 16:48:05 -05:00
Zanie
30f461b7e9 Revert formatting changes to python.rs 2023-07-10 14:26:45 -05:00
Zanie
7b0aeeec4b Add stub type_params handling for class and function definitions 2023-07-10 14:00:34 -05:00
Zanie
df2b5dfed0 Regenerate code with latest ASDL 2023-07-10 13:45:36 -05:00
Zanie
25b23998ad Update Python ASDL for Python 3.12
From 46c1097868
2023-07-10 13:15:17 -05:00
Jeong, YunWon
69d27d924c
Rename unconventional nodes (#74) 2023-06-17 01:54:00 +09:00
Jeong, YunWon
5270020423
rustpython_ast python package (#79) 2023-06-17 01:32:27 +09:00
yt2b
edcfcb4a74
Fix bool format (#91)
* Fix format_bool

* Add test_format_bool
2023-06-15 14:56:03 +09:00
Jeong, YunWon
40a603208f
Add Pylyzer
done by https://github.com/mtshiba/pylyzer/pull/37
2023-06-11 21:56:59 +09:00
Jeong, YunWon
b2f95e2848
Fix LinearLocator \r handling (#80) 2023-06-02 22:35:53 +09:00
Steve Shi
a2e3209c42
Replace num-bigint with malachite-bigint (#18)
Co-authored-by: Jeong YunWon <jeong@youknowone.org>
2023-06-02 17:06:18 +09:00
Jeong, YunWon
5e9e8a7589
Linear Locator (#46) 2023-06-01 13:53:31 +09:00
Jeong, YunWon
fdec727f80
New Arguments and Arg/ArgWithDefault AST representation (#59) 2023-06-01 01:15:23 +09:00
Jeong, YunWon
3fbf4f6804
Parse for expr and stmt variants + identifier, constant (#78) 2023-05-31 20:03:46 +09:00
Micha Reiser
fe25708d89
Merge pull request #76 from astral-sh/match-case-end-location 2023-05-31 09:48:42 +02:00
Micha Reiser
342cd19f50
Add safety comment 2023-05-31 09:37:48 +02:00
Micha Reiser
4a2c4aad0b
Align MatchCase end location 2023-05-30 17:31:51 +02:00
Jeong, YunWon
ae3a477c97
Add parser deps to rustpython_ast_pyo3 (#75) 2023-05-29 16:48:05 +09:00
Jeong, YunWon
531aeb3511
Cmpop::as_str (#72)
* clean up pyo3 generation

* Cmpop::as_str
2023-05-29 01:53:54 +09:00
Jeong, YunWon
4de0cb1827
Parse Trait (#71) 2023-05-28 21:03:27 +09:00
Micha Reiser
5493c9f4e3
Avoid removing elements from the beginning of a vec (#69) 2023-05-25 19:44:49 +09:00
Jeong, YunWon
d23611db65
Merge pull request #65 from youknowone/refactor-pyo3
to_pyo3_ast to return &'py + Separate rustpython_ast_pyo3
2023-05-23 03:03:01 +09:00
Jeong YunWon
7d384d88d0 Separate rustpython_ast_pyo3 2023-05-23 02:50:12 +09:00
Jeong YunWon
b81273e9bc to_pyo3_ast to return &'py 2023-05-23 00:12:22 +09:00
Jeong, YunWon
e1f02fced7
Fix Vec::to_pyo3_ast (#63) 2023-05-22 15:15:05 +09:00
Jeong, YunWon
d4084fb17a
impl From<T> for ast::Ast (#62) 2023-05-21 22:44:07 +09:00
Micha Reiser
33a3c407a9
Merge pull request #60 from astral-sh/reduce-copy 2023-05-19 08:16:28 +02:00
Micha Reiser
fac0c25343
Update python.rs 2023-05-19 08:08:35 +02:00
Micha Reiser
4ff779c298
Update parser/src/python.lalrpop
Co-authored-by: Jeong, YunWon <69878+youknowone@users.noreply.github.com>
2023-05-18 22:32:05 +02:00
Micha Reiser
726884b287
Avoid allocating vecs for each statement 2023-05-18 21:56:17 +02:00
Micha Reiser
851f23668f
Use named parameters to reducue copying 2023-05-18 21:41:06 +02:00
Jeong, YunWon
3654cf0bdf
Add Ast as top level enum (#58) 2023-05-19 01:53:39 +09:00