Re: Nim .18.0 whitespace issue

2018-03-16 Thread StasB
You're right. I should've checked it in the context of a case statement. It looks like the `-10` ends it, probably because the parser relies on indentation to figure out if it's still part of the case. Maybe this can be fixed by giving priority to the "invalid indentation" error you would've rec

Re: Nim .18.0 whitespace issue

2018-03-15 Thread h42
Stass, the original program err messgae was "not all cases are covered" and pointed to the start of the case statement which included the expression and it was around 30 lines from the actual error. It was hard to find because it is legal syntax in c++, python etc. It is something that I will be

Re: Nim .18.0 whitespace issue

2018-03-15 Thread StasB
> My real problem was the bad error message pointing to the wrong statement. I'm not sure what you mean by "pointing to the wrong statement". They point to the line where the error occurs, and correctly tell you what the failure is. In the first case, the compiler tells you that the `for` headin

Re: Nim .18.0 whitespace issue

2018-03-15 Thread h42
Thanks for the explanation. I saw the release note about ..< but I didn't know about the ..number shortcut. I figured nim saw -1 in x -1 as a negative 1. My real problem was the bad error message pointing to the wrong statement.

Re: Nim .18.0 whitespace issue

2018-03-15 Thread StasB
`..2` is a shortcut for `0..2`, so to the parser it looks like you have two expressions following the `in`, and it tells you there should be a colon after the first one. In your second example, `-10` is the literal for "minus ten", so again, you have two expressions after the `=`.

Re: Nim .18.0 whitespace issue

2018-03-14 Thread twetzel59
BTW, I realize this isn't involving the `<`, but maybe it is the same parser change that made it no longer work.

Re: Nim .18.0 whitespace issue

2018-03-14 Thread twetzel59
I _think_ so. This may have changed recently (since 0.18.0). [Here is the changelog](https://nim-lang.org/blog/2018/03/01/version-0180-released.html). One of the breaking changes listed says that "The unary < is now deprecated, for .. < use ..< for other usages use the ` pred` proc". So, I am t

Nim .18.0 whitespace issue

2018-03-14 Thread h42
"for i in 1 ..2:" give syntax error while "for i in 1..2 or 1 .. 2:" works. also x = x -10 gives syntax error. x = x-10 and x = x - 10 works fine. Normally, I am consistent with spaces or no spaces so this isn't a problem for me but the error message resulting from accidentally leaving out the s