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

Clearer error for mixed spaces / tabs nesting in cassius #2

Closed
rehno-lindeque opened this issue Sep 21, 2010 · 6 comments
Closed

Clearer error for mixed spaces / tabs nesting in cassius #2

rehno-lindeque opened this issue Sep 21, 2010 · 6 comments

Comments

@rehno-lindeque
Copy link

Is it possible to add a clearer error message when mixing tabs with spaces by accident in cassius?
It currently says:

Internal Server Error 
Only LineSingle may have nested content 

Perhaps you could simply add "Did you accidentally mix tabs and spaces?" as a quick fix if that is possible...?

(This is using cassiusFileDebug)

@snoyberg
Copy link
Member

I'm not sure how to figure out that it's the tabs/spaces mix which is causing the problem. One possible idea (probably a good one) is to simply ban tabs from denoting indentation; I doubt anyone will really complain.

However, the bigger issue here is... well, how do I say this politely... I did a god-awful job with the cassius error messages. What the hell does the "Only LineSingle" mean? Fixing that up should definitely rank high on my todo list.

@rehno-lindeque
Copy link
Author

Hahaha :) Hopefully this issue will serve as a reminder!

@snoyberg
Copy link
Member

Hey Rehno,

I've pushed some commits that bump Hamlet to 0.6 and hopefully make error messages from Cassius much clearer. Mind having a look? I will require modifying Persistent and Yesod to have a higher version bounds on Hamlet.

Michael

@rehno-lindeque
Copy link
Author

Thanks Michael. I quickly started upgrading to yesod 0.6 today, but it looks like I have to upgrade some stuff first! It might take me a little while to catch up with yesod development :)

@Shimuuar
Copy link

Shimuuar commented Jun 1, 2011

I'd vote to ban tabs. They may change meaning of program silently. If your editor and hamlet/cassius have different tab width it may lead either to error or it could be parsed not as you expected. Second case is real. I encountered it.

IMHO mixing tabs and significant indentation is generally bad idea™

@snoyberg
Copy link
Member

snoyberg commented Aug 5, 2011

OK, just pushed this commit, tabs for indentation give an error.

@snoyberg snoyberg closed this as completed Aug 5, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants