radon-project / radon

The Radon Programming Language
https://radon-project.github.io
GNU General Public License v3.0
23 stars 2 forks source link

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

Closed Almas-Ali closed 2 months ago

Almas-Ali commented 2 months ago

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.

angelcaru commented 2 months ago

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

Almas-Ali commented 2 months ago

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?

angelcaru commented 2 months ago

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