I know it is difficult to provide 100% accurate compiler error messages, but consider the erroneous program below:
var key: int = 1
case key:
of 0:
echo($key)
of 1:
echo($key))
else:
echo($key)
The output from the compiler is strange:
Bobs-Air:dataquery bobgus$ nim c -r parensProblem.nim
Hint: system [Processing]
Hint: parensProblem [Processing]
parensProblem.nim(2, 1) Error: not all cases are covered
After seeing the error message, I looked at the case statement - looking for a missing integer. I think the 'else' covers all the rest of the cases and so the error message is misleading.
After I accidentally found the double closing parentheses and corrected the program, it compiled fine.
A double closing parenthesis can be a common keying problem - it should be possible to detect this case - no look-ahead is required as it is a closing parenthesis.