消息 [376048]
I just noticed a subtle discrepancy between the old parser and the PEG parser.
Consider this syntax error:
```
if x {a}: pass
```
The old parser places the caret at the '{':
```
$ python3.8 -c 'if x { a } : pass'
File "<string>", line 1
if x { a } : pass
^
SyntaxError: invalid syntax
```
The PEG parser puts it at 'a':
```
$ python3.10 -c 'if x { a } : pass'
File "<string>", line 1
if x { a } : pass
^
SyntaxError: invalid syntax
```
I don't think we should put much effort into fixing it -- it's just a curiosity. I suspect it's got to do with some lookahead. |
|
| 日期 |
用户 |
动作 |
参数 |
| 2020-08-28 21:43:15 | gvanrossum | 修改 | recipients:
+ gvanrossum, lys.nikolaou |
| 2020-08-28 21:43:15 | gvanrossum | 修改 | messageid: <1598650995.75.0.684602655166.issue41659@roundup.psfhosted.org> |
| 2020-08-28 21:43:15 | gvanrossum | 链接 | issue41659 messages |
| 2020-08-28 21:43:15 | gvanrossum | 创建 | |
|