Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sway-fmt-v2/src/utils/comments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ mod tests {
.unwrap();
assert_eq!(
found_comment.1.span.as_str(),
"/* multi-\n * line-\n * comment *"
"/* multi-\n * line-\n * comment */"
);
}
}
6 changes: 3 additions & 3 deletions sway-parse/src/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,9 +418,9 @@ pub fn lex_commented(
None => return Err(unclosed_multiline_comment(unclosed_indices)),
Some((_, '*')) => match char_indices.next() {
None => return Err(unclosed_multiline_comment(unclosed_indices)),
Some((end, '/')) => {
let _ = char_indices.next();
Some((slash_ix, '/')) => {
let start = unclosed_indices.pop().unwrap();
let end = slash_ix + '/'.len_utf8();
let span =
Span::new(src.clone(), start, end, path.clone()).unwrap();
let comment = Comment { span };
Expand Down Expand Up @@ -1135,7 +1135,7 @@ mod tests {
let mut tts = group.token_stream.token_trees().iter();
assert_eq!(
tts.next().unwrap().span().as_str(),
"/* multi-\n * line-\n * comment *",
"/* multi-\n * line-\n * comment */",
);
assert_eq!(tts.next().unwrap().span().as_str(), "bar");
assert_eq!(tts.next().unwrap().span().as_str(), ":");
Expand Down