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

Detect indentation errors #104

Closed
ghost opened this issue Sep 15, 2015 · 4 comments
Closed

Detect indentation errors #104

ghost opened this issue Sep 15, 2015 · 4 comments
Milestone

Comments

@ghost
Copy link

ghost commented Sep 15, 2015

init: func ~this (original: This) {
    this init()
    for (i in 0 .. original count)
            this append(original[i] copy())
}

Line 4 has one extra leading tab. Is it possible for Magic to detect and report indentation errors such as this ?

@davidhesselbom davidhesselbom added this to the v0.2 milestone Sep 15, 2015
@thomasfanell
Copy link
Contributor

Existing issue, #70. I started to implement a check for this, but had to abort due to higher priority tasks. I'll see if I can find some time to implement it this week.

@davidhesselbom
Copy link
Contributor

It's not the same issue, really. #70 requires magic to know how things should be indented, but in the case described here, it's just a matter of detecting that indentation from one line to the next has increased by more than 1 tab, which is always wrong, no matter the contents (I think). Should be very easy to fix compared to #70.

@thomasfanell
Copy link
Contributor

If it handles this, it should be able to handle #70, otherwise I would call it unreliable. It may very well be that I approached this problem incorrectly the last time around, but it was anything but easy. I'll re-visit this soon.

@davidhesselbom
Copy link
Contributor

If you fix #70, this issue will be solved too, as a side effect. But the reverse is not true. A quick fix for the described problem won't be unreliable, it's just going to be limited to a specific type of indentation error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants