Skip to content
Merged
Changes from 1 commit
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
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