-
Notifications
You must be signed in to change notification settings - Fork 2
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
Indentation with tabs does not work #16
Comments
Concerning tabs, the short answer: This is intended behaviour. Tabs are not allowed in indentex. The long answer: I think that enforcing hard tabs was one of golang's wisest design choices (for the record, I abhor hard tabs). Compare this to Python: PEP8 suggests using soft tabs, so everybody would do this, right? Well, no:
Hence, I decided to allow only soft tabs in indentex so that everybody's on the same page. Indentex source files must be indented using soft tabs, preferably two characters wide. There is a further aspect to it, however. Indentex cannot detect mixed tabs and spaces. This can lead to very subtle and nasty edge cases. E.g. a user has configured tabs to be two chars wide and has accidentally written this:
This would be transpiled to
although visually there is no dedent after As for the indentation with a single space being valid: It's another story. Maybe it might be better to require at least two whitespace chars for a valid indentation. I have to sleep on it. |
What exactly, tabs or single-space indentation? Probably it's a good idea to generate transpilation errors for both of them! |
Indentation with tabs does not seem work.
This indentex file:
is transpiled to this:
Update: Indentation with a single space works perfectly:
->
The text was updated successfully, but these errors were encountered: