12 Commits

Author SHA1 Message Date
Jeong YunWon
dc569e9921 Refactoring 2023-05-10 19:35:27 +09:00
DimitrisJim
2da4b70e3a Mark failing tests. 2023-03-01 13:00:17 +02:00
DimitrisJim
f58014e2b3 Add test_syntax from CPython 3.11.0 2023-03-01 12:58:51 +02:00
Anders Kaseorg
52ce437951 Prohibit starred arguments after double-starred arguments
CPython prohibits ‘f(**kwargs, *args)’; we should too.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2022-12-27 12:49:50 -08:00
dvermd
f2bfb78d3c Fix ast types' _fields and use 0-based column 2022-10-27 03:09:38 +09:00
c66d22da84 Except operator cases from delete error rule 2022-07-20 18:10:42 +09:00
b490f5255b Update Lib/test/test_syntax.py to be runable 2022-07-13 16:47:31 +09:00
82efdeb391 Update Lib/test/test_syntax.py from CPython v3.10.5 2022-07-13 16:47:31 +09:00
snowapril
13bbefdd4e compiler: impl syntax error detect for global kind
This commit fixes `test_global_parap_err_first` test in
[test_syntax.py](https://github.com/RustPython/RustPython/blob/master/Lib/test/test_syntax.py#L678) and implement the other syntax errors detection as cpython 3.8 provided for global symbol.

Below syntax error conditions are added.
* name {} is parameter and global
```python
>>>>> def test(a):
.....   global a
.....
SyntaxError: name 'a' is parameter and global at line 2 column 2
        global a
```
* annotated name {} can't be global
```python
>>>>> def test():
.....   a: int
.....   global a
.....
SyntaxError: annotated name 'a' can't be global at line 3 column 2
        global a
```
* name {} is assigned to before global description
```python
>>>>> a = 100
>>>>> def test():
.....   a = 10
.....   global a
.....
SyntaxError: name 'a' is assigned to before global declaration at line 3 column 2
        global a
```
* name {} is used prior to global declaration
```python
>>>>> a = 10
>>>>> def test():
.....   print(a)
.....   global a
.....
SyntaxError: name 'a' is used prior to global declaration at line 3 column 2
        global a
```

Signed-off-by: snowapril <sinjihng@gmail.com>
2021-08-17 21:14:13 +09:00
Padraic Fanning
55d81fe40f Bypass doctests (causing CI to time out) 2021-05-16 13:48:27 -04:00
Padraic Fanning
2187e93032 Mark failing tests 2021-05-16 13:23:03 -04:00
Padraic Fanning
3298d88688 Add test_syntax from CPython 3.8 2021-05-16 13:23:02 -04:00