mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Fix multiline lexer bug
Co-authored-by: Hyeonji-Ryu <cjstk3940@naver.com>
This commit is contained in:
1 parent
bed4877f8d
commit
203d1998e2
2 files changed
+2
-4
No files matched your search
Vendored
-2
@@ -257,8 +257,6 @@ the \'lazy\' dog.\n\
|
||||
self.assertTrue(x is Ellipsis)
|
||||
self.assertRaises(SyntaxError, eval, ".. .")
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_eof_error(self):
|
||||
samples = ("def foo(", "\ndef foo(", "def foo(\n")
|
||||
for s in samples:
|
||||
|
||||
+2
-2
@@ -568,7 +568,7 @@ where
|
||||
} else {
|
||||
if (c == '\n' && !triple_quoted) || (is_bytes && !c.is_ascii()) {
|
||||
return Err(LexicalError {
|
||||
error: LexicalErrorType::StringError,
|
||||
error: LexicalErrorType::Eof,
|
||||
location: self.get_pos(),
|
||||
});
|
||||
}
|
||||
@@ -784,7 +784,7 @@ where
|
||||
// First of all, we need all nestings to be finished.
|
||||
if self.nesting > 0 {
|
||||
return Err(LexicalError {
|
||||
error: LexicalErrorType::NestingError,
|
||||
error: LexicalErrorType::Eof,
|
||||
location: tok_pos,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user