Skip to content

Commit 5fd9fc4

Browse files
kth496dev-bearabbit
andcommitted
Fix multiline string bug
Co-authored-by: Hyeonji-Ryu <cjstk3940@naver.com>
1 parent ddc801e commit 5fd9fc4

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

parser/src/lexer.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -576,10 +576,16 @@ where
576576
}
577577
}
578578
None => {
579-
return Err(LexicalError {
580-
error: LexicalErrorType::StringError,
581-
location: self.get_pos(),
582-
});
579+
return match triple_quoted {
580+
true => Err(LexicalError {
581+
error: LexicalErrorType::Eof,
582+
location: self.get_pos(),
583+
}),
584+
false => Err(LexicalError {
585+
error: LexicalErrorType::StringError,
586+
location: self.get_pos(),
587+
}),
588+
}
583589
}
584590
}
585591
}

0 commit comments

Comments
 (0)