mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-27 10:17:15 +00:00
feat(lexer): Allow including frontmatter with 'tokenize'
This commit is contained in:
parent
3a5e13a8b3
commit
f4d9018a48
3 changed files with 8 additions and 6 deletions
|
|
@ -121,7 +121,7 @@ pub(super) fn literal_from_str<Span: Copy>(
|
|||
use proc_macro::bridge::LitKind;
|
||||
use rustc_lexer::{LiteralKind, Token, TokenKind};
|
||||
|
||||
let mut tokens = rustc_lexer::tokenize(s);
|
||||
let mut tokens = rustc_lexer::tokenize(s, rustc_lexer::FrontmatterAllowed::No);
|
||||
let minus_or_lit = tokens.next().unwrap_or(Token { kind: TokenKind::Eof, len: 0 });
|
||||
|
||||
let lit = if minus_or_lit.kind == TokenKind::Minus {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue