Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,9 @@ where

while self.peek() != Some(TOKEN_SEMICOLON) {
self.parse_val();
if self.errors.last().map_or(false, |x| *x == ParseError::UnexpectedEOF) {
break;
}
}

self.expect(TOKEN_SEMICOLON);
Expand Down
13 changes: 13 additions & 0 deletions test_data/parser/inherit/2.expect
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
error: unexpected end of file
error: unexpected end of file, wanted any of [TOKEN_SEMICOLON]
error: unexpected end of file
error: unexpected end of file
NODE_ROOT 0..13 {
NODE_LET_IN 0..13 {
TOKEN_LET("let") 0..3
TOKEN_WHITESPACE("\n ") 3..6
NODE_INHERIT 6..13 {
TOKEN_INHERIT("inherit") 6..13
}
}
}
2 changes: 2 additions & 0 deletions test_data/parser/inherit/2.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
let
inherit