radon-project/radon

[BUG]: Few keywords are not throwing exception when calling from anywhere.

Almas-Ali opened this issue · 3 comments

Describe the bug
Few keywords are not throwing exception when calling from anywhere. Specially I tested from REPL.

Screenshots or Code snippets
No exception raises:

for
while
not
include
switch
if
fun
try
class
static
assert

Meaning less exception message:

in
as
case
else
elif
fallthrough
default
or
to
step
return
continue
break
nonlocal
global
const
and

Additional context
Meaning full errors are very important.

Do you mean syntax errors? If so, I believe the issue is caused here in parser.py. We should be explicitly checking for RBRACE or EOF instead of using try_register

Do you mean syntax errors? If so, I believe the issue is caused here in parser.py. We should be explicitly checking for RBRACE or EOF instead of using try_register

Yes, I have checked parser.py and that error line.
Invalid Syntax: Token cannot appear after previous tokens

Most of the time I can't determine that where is the actual error raising?

Most of the time I can't determine that where is the actual error raising?

Yeah, I noticed too, it was really annoying when writing examples given how finicky our parser is, so we definitely need to get this fixed soon