Closed dsawardekar closed 11 years ago
Thanks for the bug report once again! This is probably happening because of fileformat issues, the lexer isn't looking for carriage returns as newlines. I'll get a fix out for this by Friday. If you change the fileformat to unix set fileformat=unix
, that should make it compile for now. My guess is that it was set to dos
or mac
, and I just tested and confirmed the bug with these fileformats.
Thanks again!
@luke-gru I'm not sure this is a fileformat
issue. I'm on Ubuntu, and my fileformat is always unix
. I tried setting the whitespace to be visible with, :set listchars=eol:$,tab:>-,trail:~,extends:>,precedes:<
This shows the trailing whitespace as ~
. Riml compiles correctly when I remove the trailing whitespaces.
That's really weird. I tried to reproduce by just putting trailing '
Here's a couple of gists with the exact code, and the full stacktraces.
This pattern repeats for other statements. The error's messages are different, but I think the issues are related. And the errors do go away if you trim the trailing whitespaces.
Just figured out why I couldn't reproduce the issue initially. When I :wq
ed from vim, my autocmd to delete trailing whitespace kicked in. Forgot I had the autocmd, because at work I had to disable it due to some people's unexplained fondness for trailing whitespaces :smile:. I discovered the source of the problem, fix is coming now.
Hah! I was beginning to doubt my eyes for a bit there. :wine_glass:
@luke-gru I've narrowed down a weird issue I was seeing, while refactoring code. It was occurring mostly when doing things like adding new conditions to
if
, statements, when extracting code to a method. I think this is related to how riml handles whitespace at the end of lines.Consider this code,
This looks like valid
riml
code but it has an extra whitespace at the end of the line after thehello()
function. Without the whitespace the code compiles fine. But with the whitespace you get the following error,On further exploration I found this happens for nearly all statements. If you happen to accidentally add whitespace to code that was working earlier, it stops, with an error message very similar to the above.