EOF after `\\` raise EOF Error · ugaemi/RustPython@cdd9813 · GitHub
Skip to content

Commit cdd9813

Browse files
committed
EOF after \\ raise EOF Error
Return EOF Error to get the next line after` \\ `in the shell. Closes RustPython#1928
1 parent 7c51a91 commit cdd9813

3 files changed

Lines changed: 14 additions & 1 deletion

File tree

parser/src/error.rs

Lines changed: 2 additions & 0 deletions

parser/src/lexer.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,6 +1191,13 @@ where
11911191
location: self.get_pos(),
11921192
});
11931193
}
1194+
1195+
if self.chr0.is_none() {
1196+
return Err(LexicalError {
1197+
error: LexicalErrorType::EOF,
1198+
location: self.get_pos(),
1199+
});
1200+
}
11941201
}
11951202

11961203
_ => {

src/shell.rs

Lines changed: 5 additions & 1 deletion

0 commit comments

Comments
 (0)