Revert "For # to start a comment, then it either need to be the first chara…" (#14560)

Reverts nushell/nushell#14548

I'm finding may oddities
This commit is contained in:
Darren Schroeder
2024-12-11 07:08:15 -06:00
committed by GitHub
parent 4f20c370f9
commit 1a573d17c0
3 changed files with 2 additions and 51 deletions

View File

@ -159,29 +159,6 @@ fn lex_comment() {
);
}
#[test]
fn lex_not_comment_needs_space_in_front_of_hashtag() {
let file = b"1..10 | each {echo test#testing }";
let output = lex(file, 0, &[], &[], false);
assert!(output.1.is_none());
}
#[test]
fn lex_comment_with_space_in_front_of_hashtag() {
let file = b"1..10 | each {echo test #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 | ;";