AndrasKovacs/sett

Properly handling trailing newline

Closed this issue · 1 comments

Extending the second branch of topLevel as we've discussed (ws >> eof) was not enough, as the parser eagerly commits to parsing a top-level definition as soon as it gets to the ending newline with zero indentation.

I have added a workaround in e7395d9 by extending the indentation check with a condition that ensures that the file does not end immediately after the newline character, but there is probably a cleaner solution.

I added a slightly cleaner solution in 128f50f.