From a quick skim over the lexer module, it looks like \r\n is correctly detected, but then after incrementing the line counter only the \r is consumed. This results in line numbers that are off by a factor of two on Windows.
Add unit test for line counting behavior (issue #28).
Fix line counting for Windows-style line endings. Fixes #28.