Commit Graph

342 Commits

Author SHA1 Message Date
Jeong Yunwon
dd2bf4c96b fix clippy 2022-07-21 06:45:28 +09:00
f51ad1954f Update to parse `group' expression
In CPython, group expression parse single yield and named expression, and handle invalid starred expression at the same time.

I added it such parsing algorithm.

Update python.lalrpop
2022-07-20 18:10:42 +09:00
6b56e51fc1 Change expression parser for del statement
Now star expression can be a argumnet for del statement.
2022-07-20 18:10:42 +09:00
Jeong YunWon
d9d453819e Merge pull request #3783 from ChJR/feature/fix_decorators
Fix decorators
2022-07-16 23:43:19 +09:00
ChJR
8ef21ee628 Apply PEP 614
Check 'Named Expressions Need Not Be Parenthesized' Section
2022-07-16 21:28:01 +09:00
dennis zhuang
7be4860fac fix: non-utf8 source causes panic, close #3798 (#3884)
Co-authored-by: fanninpm <fanninpm@miamioh.edu>
2022-07-15 15:46:41 +09:00
Taehong Kim
6095f882cf Simplify boolean matching
Co-authored-by: Snowapril <sinjihng@gmail.com>
2022-07-15 14:32:20 +09:00
kth496
5fd9fc40a9 Fix multiline string bug
Co-authored-by: Hyeonji-Ryu <cjstk3940@naver.com>
2022-07-15 05:43:01 +09:00
kth496
203d1998e2 Fix multiline lexer bug
Co-authored-by: Hyeonji-Ryu <cjstk3940@naver.com>
2022-07-13 17:02:17 +09:00
Dennis Zhuang
623a78dbf9 fix panic when parsing invalid decimal, close #3796 2022-06-19 22:34:34 +08:00
Noa
ceb59abbd9 Speedup compile time for rustpython-parser 2022-04-24 10:36:02 -05:00
Jeong Yunwon
6357a1acbe clean up imports and useless allow attributes 2022-04-15 23:58:20 +09:00
Padraic Fanning
f2257a93b0 Allow proper recursion in f-string format specs 2022-02-04 14:59:28 -05:00
Padraic Fanning
a1dffe671e Allow replacement fields in format specs 2022-02-04 14:59:28 -05:00
Padraic Fanning
04886d825d Allow brackets in f-string format spec 2022-02-04 14:59:27 -05:00
Noa
09e9ea91e7 TryFrom, TryInto, FromIterator are in prelude now 2021-10-21 17:04:19 -05: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
f336a00177 Fix rustpython-parser tests 2021-10-17 21:55:34 -05:00
Noa
0cd2b0787a Keep u-prefixed strings through to the AST 2021-10-17 21:55:34 -05:00
Chris Moradi
8bb1aabf2e Fix error message for named expression syntax errors 2021-10-02 13:43:50 -07:00
Padraic Fanning
0ea56025ec Replace master with main
Fixes #3067
2021-09-15 17:54:54 -04:00
이성빈
d7e9c7d39e raise syntax error when '_' after 'e' or 'E' 2021-09-05 21:02:50 +09:00
Nikita Sobolev
ba74a9a239 Fixes typos in all other files 2021-08-22 12:42:13 +09:00
Jeong YunWon
b2115c9009 Fix unnessessary while let 2021-07-30 02:32:16 +09:00
Noah
e21a447400 Fix misc codecs issues 2021-05-21 01:32:55 -05:00
Padraic Fanning
0174e386a1 Fix inconsistent_struct_constructor Clippy warning 2021-05-07 17:00:38 -04:00
Jeong YunWon
843895c04d Merge pull request #2531 from RustPython/clippy-1.51
Fix clippy warnings for 1.51
2021-03-28 02:36:20 +09:00
Noah
76f8ed5299 Fix clippy warnings for 1.51 2021-03-26 17:54:22 -05:00
Noah
7961ec9aaa Update parser snapshot tests with new BigInt Debug repr 2021-03-25 08:06:58 -05:00
Noah
bcf58d9091 Misc fixes 2021-01-14 12:37:37 -06:00
Noah
b8aabb7bb7 Implement asdl in the ast and parser 2021-01-14 12:37:37 -06:00
Noah
56c225c748 Use ahash/phf in parser 2021-01-08 17:09:09 -06:00
Jeong YunWon
1c12a80682 Merge pull request #2392 from RustPython/fix-clippy-1.49
Fix clippy lints for Rust 1.49
2021-01-08 11:32:45 +09:00
pca006132
0af925051c changed Default::default() to () 2021-01-04 14:45:36 +08:00
pca006132
af3e7dee69 Implements AST Customization (#2388) 2021-01-04 10:33:22 +08:00
Noah
be40a5d7b9 Fix clippy lints for Rust 1.49 2021-01-02 19:30:57 -06:00
Noah
99a8d68933 Fix test_exceptions.testRaising 2020-12-19 15:09:20 -06:00
Noah
5a56dd1a77 repr() functions with their names 2020-12-17 16:29:44 -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
0cbdb8a208 Merge pull request #2346 from isidentical/issue-2345
Fix crash on lexing octal escapes bigger than u8::MAX
2020-11-30 10:34:17 -06:00
Batuhan Taskaya
d14176146a Directly unwrap 2020-11-30 18:04:38 +03:00
Batuhan Taskaya
698ae764f1 Handle raw yield expressions as RHS for augmented/annotated assignments 2020-11-30 03:11:09 +03:00
Batuhan Taskaya
e26df2c793 Apply cargo fmt 2020-11-29 20:11:48 +03:00
Batuhan Taskaya
26908f17ed Fix crash on lexing octal escapes bigger than u8::MAX 2020-11-29 20:11:48 +03:00
Batuhan Taskaya
a382284d30 PEP 498 compatability: parenthesized expressions for f-strings 2020-11-29 17:57:49 +03:00
Noah
b3851c8eb8 Split the ast from the parser, remove compiler dep on parser 2020-11-07 15:43:23 -06:00
Jeong YunWon
3cd0a1118d Fix nightly clippy 2020-10-01 07:08:55 +09:00
Noah
50e19037fd Fix lalrpop semver error 2020-09-08 19:59:22 -05:00
Noah
1385c06e25 Fix some minor things required for unittest 2020-08-12 16:03:20 -05:00
TheAnyKey
fd2e0aa41e Implement Py38 named expression (PEP 572) (#1934)
* Initial implementation of named expression and  import  according CPython tests

* added new instruction with inversed evaluation order for dict comprehension, in other cases use regular evaluation order

* added further aspects to implementation, cleaned up, imported test from CPython

* implemented first parts of scoping enhancement and extended checks

* completion of name resolution ongoing, now more test passing, still warinings and cleanup required

* further optimization of name resolution in nested scopes

* Initialize the vm with imports from _io instead of io

* Add the OpenBSD support that I am smart enough to

* adapted grammer to full support, most test are passing now, esp. all invalids are passed. Cleaned up in symboltable

* more conditional compiling, this time for errors

* rustfmt was not pleased

* premature push, whoops

* Add expected_failure result type to jsontests

* Initial implementation of named expression and  import  according CPython tests

* added new instruction with inversed evaluation order for dict comprehension, in other cases use regular evaluation order

* added further aspects to implementation, cleaned up, imported test from CPython

* implemented first parts of scoping enhancement and extended checks

* completion of name resolution ongoing, now more test passing, still warinings and cleanup required

* further optimization of name resolution in nested scopes

* adapted grammer to full support, most test are passing now, esp. all invalids are passed. Cleaned up in symboltable

* Fixed nameing convention violation and removed unnecessary information from symbol resolution. Added some more comments.

* Fixed nameing convention violation and removed unnecessary information from symbol resolution. Added some more comments.

Co-authored-by: Noah <33094578+coolreader18@users.noreply.github.com>
Co-authored-by: Reuben Staley <lighthousemaniac@gmail.com>
2020-06-01 11:22:15 +02:00