Closed crwecker closed 6 years ago
The error "TabCount is less than zero for..." is when the formatter "closes" more indentation blocks than it opens. I would expect the following invalid code to produce that error as well.
if true then
doSomething()
end if
end if
However, I'm sure it's a bug where the code is not properly determining when a block opens and closes.
For item 2, I'll bet the bug is related to the word "next" being a keyword. I'll have to tighten up the tokenizer's regex matchers.
I'll try reproducing these locally and see if I can come up with a fix.
Thanks for passing these along!
The issue with item 1 is that the tokenizer is converting
else
if
into
else if
Which is obviously not correct.
Similar issue with item 2. The tokenizer is identifying "next" as a keyword, when it should be an identifier based on where it's placed.
Good catches!
@crwecker I believe that I fixed both of these issues and published to npm. Upgrade to version 1.1.1 and let me know how it goes!
Worked great for the couple of files I checked. Thanks again for putting this together and for being so responsive!!
You're quite welcome. It's nice knowing someone else other than myself is using this. :D
I'm getting the following error in the following situations: