Commit Graph

129 Commits

Author SHA1 Message Date
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
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
Batuhan Taskaya
698ae764f1 Handle raw yield expressions as RHS for augmented/annotated assignments 2020-11-30 03:11:09 +03:00
Noah
b3851c8eb8 Split the ast from the parser, remove compiler dep on parser 2020-11-07 15:43:23 -06: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
TheAnyKey
90e52ab514 merged and prepared for PR 2020-05-16 14:33:30 +00:00
TheAnyKey
ebebda3ca6 implementation of generalized decorators and test update from cpython 2020-05-16 14:33:30 +00:00
Noah
b6d155df8b Make Location Copy and remove all location.clone()s 2020-03-13 21:49:10 -05:00
Jeong YunWon
aa1d20c388 positional only parameter support 2020-03-08 00:13:13 +09:00
Jeong YunWon
1abe7e3313 Allow star expression for list elements 2020-02-16 17:32:51 +09:00
Seo Sanghyeon
e76edde38e Implement IndentationError 2019-10-12 02:24:12 +09:00
Seo Sanghyeon
bdb6208f6f Do not panic in parser 2019-10-03 19:41:12 +09:00
HyeonGyu Lee (Vazrupe)
0ab46fd2bd Add Positional argument error to LexicalError
Fixes #1046
2019-09-13 01:46:31 +09:00
Windel Bouwman
19112cef49 Require at least finally or except on a try statement. 2019-08-19 09:00:08 +02:00
Windel Bouwman
3ed71308bf Repair try-except-else syntax. Fixes #1300. 2019-08-19 08:37:07 +02:00
Windel Bouwman
d83cfb4cef Merge pull request #1234 from RustPython/short-circuit-evaluation
Improve the situation regarding boolean operations.
2019-08-12 07:30:28 +02:00
Windel Bouwman
36d8147e8e Improve the situation regarding boolean operations. 2019-08-11 20:20:15 +02:00
Windel Bouwman
a400f6631c Improve lexing of numbers with underscores. 2019-08-11 09:29:21 +02:00
Windel Bouwman
fc8aba1b68 Merge pull request #1215 from RustPython/syntax-fixes
Add variable annotation syntax.
2019-08-09 11:22:55 +02:00
Windel Bouwman
2fdfcb96a5 Add parser support for async for loop. Add yield expression inside parentheses. 2019-08-07 20:11:27 +02:00
Windel Bouwman
ded9d5ba5b Add variable annotation syntax. Simplify grammar for comprehensions. Add capital J suffix for complex numbers. 2019-08-07 15:31:24 +02:00
Windel Bouwman
de89349d8d Fix import syntax to require at least one imported symbol. Fixes #1211. 2019-08-07 13:00:34 +02:00
Windel Bouwman
19dd58cbad Add star expression in set literals. 2019-08-02 20:55:37 +02:00
Windel Bouwman
1024281014 Add support for star expression in tuple. 2019-07-27 13:10:55 +02:00
Windel Bouwman
1fddce461f Implement review comments and improve parsing a bit. 2019-07-25 23:54:31 +02:00
Windel Bouwman
e922a6a952 Fix trailing newline issue #17 2019-07-21 14:00:55 +02:00
Windel Bouwman
d6c19c1c6a Add location to expressions. Change symboltable to use flags for symbols. 2019-07-20 20:44:38 +02:00
Windel Bouwman
ff762d7109 Address relative import with 3 dots. Closes #1052. 2019-07-15 21:41:43 +02:00
Windel Bouwman
0741c36bb8 Simplify import AST in line with CPython. 2019-07-15 21:00:28 +02:00
Windel Bouwman
e06de30eb6 Implement more nodes in the ast. Add script to walk over AST of sourcecode. 2019-07-14 21:18:49 +02:00
Windel Bouwman
18bb56330e Merge pull request #1115 from RustPython/fstring-fix
Improve f-string syntax. Fixes #1099
2019-07-07 19:42:21 +02:00
Windel Bouwman
7e138eca3b Improve f-string syntax. Fixes #1099 2019-07-07 12:04:43 +02:00
Windel Bouwman
97f982530a parser error handling improvements. 2019-07-06 20:18:18 +02:00
Aviv Palivoda
0d8d2e3beb Calculate import level at parsing 2019-06-29 17:04:31 +03:00
Aviv Palivoda
12a3028806 Import all from_list in one __import__ call 2019-06-14 08:27:49 +03:00
Jeong YunWon
e12c6813ef Add dict unpacking support for literal 2019-05-07 04:42:58 +09:00
Windel Bouwman
b3b523ffa9 Add await syntax. 2019-05-02 17:11:51 +02:00
Windel Bouwman
5bc1aa08dc Add async def and async for parsing. 2019-05-02 16:55:33 +02:00
Windel Bouwman
ab3d004c42 Fix syntax for float literals, statements seperated by semicolons and starargs after keyword arguments. 2019-04-05 21:59:20 +02:00
Windel Bouwman
29a137bf0f Drop testlist2. Also add test cases for trailing comma in for statement and tuple addition example. 2019-04-03 22:24:19 +02:00
Windel Bouwman
23f57f757c Improve trailing comma situation 2019-04-03 14:08:12 +02:00
Adrian Wielgosik
2fb3fc92ec Support chained comparisons 2019-04-02 23:22:54 +02:00
Windel Bouwman
69c81730d3 Merge pull request #760 from RustPython/parser-fixes
Add support for trailing comma in function defs. Parser code simplica…
2019-03-31 10:57:51 +02:00
coolreader18
1b57f07834 Process lalrpop in cargo's target directory 2019-03-30 22:56:37 -05:00
Windel Bouwman
73cd680d8d Add support for trailing comma in function defs. Parser code simplications. 2019-03-28 17:50:41 +01:00
coolreader18
ab53883f67 Change varargs from Option<Option<_>> to its own enum 2019-03-19 19:53:22 -05:00
Windel Bouwman
0292146a42 Add subscript list in grammar. 2019-03-05 17:28:15 +01:00
Adam
d278fb841c Merge pull request #597 from RustPython/type_hints
Add type annotations to parser.
2019-03-05 14:43:30 +00:00