Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide better error message (or more specific to situation) for evaluation order issues. #54

Open
pbennett opened this issue Jan 27, 2023 · 2 comments
Labels
enhancement Planned new feature or improvement

Comments

@pbennett
Copy link

A statement like:
if a == 2 && b ==3:
will yield an error like:
Error: Cannot parse "if a == 2 && b ==3" as Expression at line 100

I had a more involved if statement in my particular case but I fought for quite a bit of time trying to figure out what was wrong (and there's no examples in the repo of an && expression like above) until I realized it wanted
if (a==2) && (b==3):

Tealish should make it extremely clear that the evaluation order isn't defined and needs to be. The error instead reads almost like a generic 'something's wrong' - ie: a syntax error.

@fergalwalsh
Copy link
Collaborator

Yep, this is definitely an area that needs attention. I do want the errors to be very precise and useful but it will take a bit of work to get there. Definitely in the plan though.

@pbennett
Copy link
Author

Somewhat related, but this goes for a number of issues. Errors with no line number information and stack traces with confusing exceptions.

ie: I had a block that was missing an end statement (I think it was commented out) and the error message was a stack trace wall

ending with the message: "AttributeError: 'NoneType' object has no attribute 'startswith'".

I'd think a missing end would be very easy to detect as it's basically a nested declaration of func/block, etc.

@fergalwalsh fergalwalsh added the enhancement Planned new feature or improvement label Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Planned new feature or improvement
Projects
None yet
Development

No branches or pull requests

2 participants