diff options
| author | Ed Page <eopage@gmail.com> | 2025-07-09 16:40:22 -0500 |
|---|---|---|
| committer | Ed Page <eopage@gmail.com> | 2025-07-09 16:42:27 -0500 |
| commit | 45a1e492b1adfc6f7664d1da736dff147e5c3168 (patch) | |
| tree | 8e7a7a4cd1084e16fae200a80d5bafae5a8c6547 /compiler/rustc_ast_pretty | |
| parent | 425cd0f571b3888be81ebad295af8e3c903fb244 (diff) | |
| download | rust-45a1e492b1adfc6f7664d1da736dff147e5c3168.tar.gz rust-45a1e492b1adfc6f7664d1da736dff147e5c3168.zip | |
feat(lexer): Allow including frontmatter with 'tokenize'
Diffstat (limited to 'compiler/rustc_ast_pretty')
| -rw-r--r-- | compiler/rustc_ast_pretty/src/pprust/state.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_ast_pretty/src/pprust/state.rs b/compiler/rustc_ast_pretty/src/pprust/state.rs index aff98c63bcb..9d656253f72 100644 --- a/compiler/rustc_ast_pretty/src/pprust/state.rs +++ b/compiler/rustc_ast_pretty/src/pprust/state.rs @@ -120,7 +120,7 @@ fn gather_comments(sm: &SourceMap, path: FileName, src: String) -> Vec<Comment> pos += shebang_len; } - for token in rustc_lexer::tokenize(&text[pos..]) { + for token in rustc_lexer::tokenize(&text[pos..], rustc_lexer::FrontmatterAllowed::No) { let token_text = &text[pos..pos + token.len as usize]; match token.kind { rustc_lexer::TokenKind::Whitespace => { |
