Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(repl): use SWC lexer to highlight and validate #8496

Merged
merged 9 commits into from
Nov 27, 2020
Merged
Prev Previous commit
Next Next commit
fmt
  • Loading branch information
Liamolucko committed Nov 27, 2020
commit 916c5b40dcb374c7004632f61300182120415b95
14 changes: 6 additions & 8 deletions cli/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,14 +460,12 @@ pub fn lex(
})
.collect();

tokens.extend(flatten_comments(comments).map(|comment| {
LexedItem {
span: comment.span,
inner: TokenOrComment::Comment {
kind: comment.kind,
text: comment.text,
},
}
tokens.extend(flatten_comments(comments).map(|comment| LexedItem {
span: comment.span,
inner: TokenOrComment::Comment {
kind: comment.kind,
text: comment.text,
},
}));

tokens.sort_by_key(|item| item.span.lo.0);
Expand Down