Preserve empty location for empty files

Without a region, error messages in exceptions are unable to print
a filename.

By retaining the location in a zero-length region and detecting this
when formatting the exception text it is possible to print the filename
and explicitly state that the file is completely empty.

Fixes #160
This commit is contained in:
Oliver Kahrmann
2021-05-25 20:51:08 +02:00
parent 0c4594f59a
commit 58542d36be
3 changed files with 18 additions and 3 deletions

View File

@@ -1943,6 +1943,8 @@ I appreciate the help of the contributors who introduced the great feature to th
- Add missing include files
- sneakypete81 (@sneakypete81)
- Fix typo in error message
- Oliver Kahrmann (@founderio)
- Fix missing filename in error message if parsed file is empty
## Licensing terms