Commit graph

248 commits

Author SHA1 Message Date
Zanie
4776f689ae Add test for type identifier assignment 2023-07-17 09:12:36 -05:00
Zanie
8e5d0cc385 Add parenthized multiline type alias test case 2023-07-17 09:12:36 -05:00
Zanie
e2e1c2b705 Add test for parenthized multiline type as identifier 2023-07-17 09:12:36 -05:00
Zanie
1622c8f2da Add multiline type alias tests with line continuations 2023-07-17 09:12:36 -05:00
Zanie
7bbd80eb6c Add some multiline identifier tests 2023-07-17 09:12:36 -05:00
Zanie
d1c319ba15 Use match statement in soft keyword token handler 2023-07-17 09:12:36 -05:00
Zanie Blue
bbedb61607 Restore comment specific to match/case 2023-07-17 09:12:36 -05:00
Zanie
2e95af73c4 Move soft keyword cases to proper test 2023-07-17 09:12:36 -05:00
Zanie
4b99996f96 Add handling for soft keywords as type alias names 2023-07-17 09:12:36 -05:00
Zanie
50f1b6a3ec Add more cases to type identifier test 2023-07-17 09:12:36 -05:00
Zanie
b5e0f57076 Add tests from the CPython corpus 2023-07-17 09:12:36 -05:00
Zanie
b9d283fd2d Format 2023-07-17 09:12:36 -05:00
Zanie
f96642aac4 Add parsing of type alias statements 2023-07-17 09:12:24 -05: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
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
Zanie
7516c4248c Move type_param stubs into LALRPOP definition 2023-07-11 09:42:45 -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
Jeong, YunWon
69d27d924c
Rename unconventional nodes (#74) 2023-06-17 01:54:00 +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
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
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
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
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
6c5c311bab
Fix range field order (#56)
* Skip validate_arguments when empty

* Fix `range` field order

* Fix unused variable
2023-05-18 21:44:01 +09:00
Jeong, YunWon
ff17f6e178
Add utilities to enum (#44)
* Add utilities to enum

* Fix unexpected pyo3 dependency propagation
2023-05-16 23:29:49 +09:00
Jeong, YunWon
9d47d3d212
specialize ConversionFlag (#42)
* specialize ConversionFlag

* Change value of ConversionFlag to i8 and None to -1

* is_* methods to ConversionFlag
2023-05-16 22:52:50 +09:00
Jeong, YunWon
0c7d16b61a
Add is_* methods to Tok (#39) 2023-05-16 16:08:25 +09:00
Jeong, YunWon
735c06d5f4
Fix full-lexer feature (#38) 2023-05-16 15:45:03 +09:00
Charlie Marsh
10dda125ff
Always emit non-logical newlines for 'empty' lines (#27) 2023-05-15 14:13:05 -04:00
Jeong, YunWon
27e3873dc2
Add full-lexer feature (#36) 2023-05-16 02:21:34 +09:00
Micha Reiser
dd4cc25227
Reduce copying elements when parsing (#35) 2023-05-15 23:20:44 +09:00
Micha Reiser
192379cede
Move range from Attributed to Nodes (#22)
* Move `range` from `Attributed` to `Node`s

* No Attributed + custom for Range PoC

* Generate all located variants, generate enum implementations

* Implement `Copy` on simple enums

* Move `Suite` to `ranged` and `located`

* Update tests
---------

Co-authored-by: Jeong YunWon <jeong@youknowone.org>
2023-05-15 15:08:12 +09:00
Micha Reiser
a983f4383f
Add format and cformat modules from RustPython (#24)
* Add `format` and `cformat` modules from `RustPython`

* Introduce `rustpython-format` crate

* Remove unused dependencies
2023-05-12 18:27:05 +09:00
Jeong YunWon
cbe4e8c5f3 Make parser location optional 2023-05-11 04:40:10 +09:00
Jeong YunWon
aabc96dde9 ruff integration support 2023-05-11 04:08:57 +09:00
Jeong YunWon
822cac5aa0 parse_expression{=>_starts}_at 2023-05-10 21:25:58 +09:00
Jeong YunWon
aa101e4f26 fix ImportDots 2023-05-10 20:31:04 +09:00
Jeong YunWon
6fa3d0f90a Fine-tune int types 2023-05-10 19:33:39 +09:00