#10327 Now hashtags get parsed as comment starters if they are prefixed with any whitespace.

This commit is contained in:
RobbingDaHood
2024-12-18 09:05:04 +01:00
parent 4604e12eb0
commit 0dae22d438
2 changed files with 19 additions and 2 deletions

View File

@@ -182,6 +182,20 @@ fn lex_comment_with_space_in_front_of_hashtag() {
));
}
#[test]
fn lex_comment_with_tab_in_front_of_hashtag() {
let file = b"1..10 | each {echo test\t#testing }";
let output = lex(file, 0, &[], &[], false);
assert!(output.1.is_some());
assert!(matches!(
output.1.unwrap(),
ParseError::UnexpectedEof(missing_token, span) if missing_token == "}"
&& span == Span::new(33, 34)
));
}
#[test]
fn lex_is_incomplete() {
let file = b"let x = 300 | ;";