Merge pull request #7329 from tausbn/tausbn/python-fix-syntax-error-locations

Python: Fix syntax error locations
This commit is contained in:
yoff
2021-12-07 22:45:35 +01:00
committed by GitHub
6 changed files with 28 additions and 3 deletions

View File

@@ -1 +1 @@
| nonsense.py:1:14:1:14 | Syntax Error | Syntax Error (in Python 2). |
| nonsense.py:0:1:0:1 | Syntax Error | Syntax Error (in Python 2). |

View File

@@ -0,0 +1,16 @@
| test.py:0:0:0:0 | Module test |
| test.py:1:1:5:2 | With |
| test.py:2:5:2:15 | CtxManager1 |
| test.py:2:5:2:17 | CtxManager1() |
| test.py:2:22:2:29 | example1 |
| test.py:3:5:3:15 | CtxManager2 |
| test.py:3:5:3:17 | CtxManager2() |
| test.py:3:5:3:29 | With |
| test.py:3:22:3:29 | example2 |
| test.py:4:5:4:15 | CtxManager3 |
| test.py:4:5:4:17 | CtxManager3() |
| test.py:4:5:4:29 | With |
| test.py:4:22:4:29 | example3 |
| test.py:4:31:4:30 | |
| test.py:4:31:4:30 | With |
| test.py:6:5:6:8 | Pass |

View File

@@ -0,0 +1,6 @@
with (
CtxManager1() as example1,
CtxManager2() as example2,
CtxManager3() as example3,
):
pass

View File

@@ -0,0 +1,3 @@
import python
select any(AstNode n)

View File

@@ -1 +1 @@
| nonsense.py:1:2:1:2 | Syntax Error | Syntax Error (in Python 3). |
| nonsense.py:0:1:0:1 | Syntax Error | Syntax Error (in Python 3). |

View File

@@ -1,2 +1,2 @@
| bad_encoding.py:2:11:2:11 | Encoding Error | Extraction failed in bad_encoding.py with error 'utf-8' codec can't decode byte 0x9d in position 87: invalid start byte | 1 |
| syntax_error.py:1:31:1:31 | Syntax Error | Extraction failed in syntax_error.py with error Syntax Error | 1 |
| syntax_error.py:1:1:1:1 | Syntax Error | Extraction failed in syntax_error.py with error Syntax Error | 1 |