aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libexpr/parser.y4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libexpr/parser.y b/src/libexpr/parser.y
index 476403c4c..727ee94b4 100644
--- a/src/libexpr/parser.y
+++ b/src/libexpr/parser.y
@@ -62,6 +62,10 @@ using namespace nix;
void yyerror(YYLTYPE * loc, yyscan_t scanner, ParserState * state, const char * error)
{
+ if (std::string_view(error).starts_with("syntax error, unexpected end of file")) {
+ loc->first_column = loc->last_column;
+ loc->first_line = loc->last_line;
+ }
throw ParseError({
.msg = HintFmt(error),
.pos = state->positions[state->at(*loc)]