Ilya Zakharevich on Sat, 26 Mar 2022 00:08:52 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Parser’s bug? Parentheses in an "s"-type argument


On Fri, Mar 25, 2022 at 10:42:49AM +0100, Bill Allombert wrote:
> What happen here is that 
> print(a"\t"a+=b) is parsed as 
> print(a<ERROR>"\t"<ERROR>a+=b)
> and the <ERROR> token are replaced by ','

This was clear from the start.

> but
> print(a"\t"(a+=b)) is parsed as 
> print(a<ERROR>"\t"(a+=b))

But this is WHAT I REPORTED:

> because for the parser point of view, "\t"(a+=b) is a function call,
> not a syntax error.

And this is exactly what I reported as a bug.

Hope this helps,
Ilya