➜

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

作者 gvanrossum
收信人 gvanrossum, lys.nikolaou
日期 2020-08-28.21:43:15
SpamBayes Score -1.0
Marked as misclassified 是
Message-id <1598650995.75.0.684602655166.issue41659@roundup.psfhosted.org>
In-reply-to
内容
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:15gvanrossum修改recipients: + gvanrossum, lys.nikolaou
2020-08-28 21:43:15gvanrossum修改messageid: <1598650995.75.0.684602655166.issue41659@roundup.psfhosted.org>
2020-08-28 21:43:15gvanrossum链接issue41659 messages
2020-08-28 21:43:15gvanrossum创建