about summary refs log tree commit diff
path: root/src/librustdoc/html/highlight.rs
AgeCommit message (Collapse)AuthorLines
2020-07-14rustdoc: glue tokens before highlightingAndy Russell-14/+37
Fixes #72684. This commit also modifies the signature of `Classifier::new` to avoid copying the source being highlighted.
2020-04-16Dogfood or_patterns in rustdocJosh Stone-6/+2
2020-03-06fix various typosMatthias Krüger-1/+1
2020-02-29Rename `syntax` to `rustc_ast` in source codeVadim Petrochenkov-1/+1
2020-02-29Make it build againVadim Petrochenkov-1/+1
2020-02-22Rename CodeMap to SourceMap follow upMaxim Zholobak-2/+2
2020-02-011. move node_id to syntaxMazdak Farrokhzad-1/+1
2. invert rustc_session & syntax deps 3. drop rustc_session dep in rustc_hir
2020-01-26Fix run button positionning in case of scrollingGuillaume Gomez-7/+4
2020-01-17rustdoc: Catch fatal errors when syntax highlightingOliver Middleton-2/+3
For some errors the lexer will unwind so we need to handle that in addition to handling `token::Unknown`.
2020-01-15rustdoc: HTML escape codeblocks which fail syntax highlightingOliver Middleton-1/+1
2020-01-02Normalize `syntax::symbol` imports.Mazdak Farrokhzad-1/+1
2020-01-02Normalize `syntax::source_map` imports.Mazdak Farrokhzad-1/+1
2020-01-01Rename `syntax_pos` to `rustc_span` in source codeVadim Petrochenkov-1/+1
2019-12-22Format the worldMark Rousskov-61/+81
2019-11-20Delete ProcessCfgModMark Rousskov-2/+1
The previous commit removes the use of this, and now we cleanup.
2019-11-10move syntax::parse -> librustc_parseMazdak Farrokhzad-2/+2
also move MACRO_ARGUMENTS -> librustc_parse
2019-11-10move config.rs to libsyntax_expandMazdak Farrokhzad-1/+2
2019-11-07syntax::parser::token -> syntax::tokenMazdak Farrokhzad-1/+1
2019-11-03use silent emitter for rustdoc highlighting passAndy Russell-2/+2
2019-10-15syntax::parse::sess -> syntax::sessMazdak Farrokhzad-2/+2
2019-08-05adapt rustdoc to infailable lexerAleksey Kladov-13/+14
2019-08-05add unknown tokenAleksey Kladov-1/+1
2019-07-04cleanup lexer constructorsAleksey Kladov-11/+11
2019-07-04remove StringReader::peekAleksey Kladov-9/+20
The reader itself doesn't need ability to peek tokens, so it's better if clients implement this functionality. This hopefully becomes especially easy once we use iterator interface for lexer, but this is not too easy at the moment, because of buffered errors.
2019-06-08syntax: Move most of the `TokenKind` methods to `Token`Vadim Petrochenkov-1/+1
2019-06-06syntax: Remove duplicate span from `token::Ident`Vadim Petrochenkov-2/+2
2019-06-06syntax: Use `Token` in `StringReader` and `TokenTreesReader`Vadim Petrochenkov-5/+5
2019-06-06syntax: Use `Token` in `TokenTree::Token`Vadim Petrochenkov-2/+2
2019-06-06syntax: Rename `TokenAndSpan` into `Token`Vadim Petrochenkov-15/+15
2019-05-23syntax: Turn `token::Lit` into a structVadim Petrochenkov-7/+7
2019-05-22Restore the old behavior of the rustdoc keyword check + Fix rebaseVadim Petrochenkov-7/+7
2019-05-11Keep the original token in `ast::Lit`Vadim Petrochenkov-0/+2
2019-02-23Transition librustdoc to 2018 editionHirokazu Hata-1/+1
2019-02-10rustc: doc commentsAlexander Regueiro-1/+1
2019-01-20Auto merge of #56884 - euclio:codeblock-diagnostics, r=QuietMisdreavusbors-37/+55
rustdoc: overhaul code block lexing errors Fixes #53919. This PR moves the reporting of code block lexing errors from rendering time to an early pass, so we can use the compiler's error reporting mechanisms. This dramatically improves the diagnostics in this situation: we now de-emphasize the lexing errors as a note under a warning that has a span and suggestion instead of just emitting errors at the top level. Additionally, this PR generalizes the markdown -> source span calculation function, which should allow other rustdoc warnings to use better spans in the future. Last, the PR makes sure that the code block is always emitted in the docs, even if it fails to highlight correctly. Of note: - The new pass unfortunately adds another pass over the docs to gather the doc blocks for syntax-checking. I wonder if this could be combined with the pass that looks for testable blocks? I'm not familiar with that code, so I don't know how feasible that is. - `pulldown_cmark` doesn't make it easy to find the spans of the code blocks, so the code that calculates the spans is a little nasty. It works for all the test cases I threw at it, but I wouldn't be surprised if an edge case would break it. Should have a thorough review. - This PR worsens the state of #56885, since those certain fatal lexing errors are now emitted before docs get generated at all.
2019-01-18Add token::ErrYuki Okushi-1/+1
2019-01-14rustdoc: check code block syntax in early passAndy Russell-37/+55
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-02Remove not used `DotEq` tokenyui-knk-1/+1
Currently libproc_macro does not use `DotEq` token. https://github.com/rust-lang/rust/pull/49545 changed libproc_macro to not generate `DotEq` token.
2018-10-26Rollup merge of #54921 - GuillaumeGomez:line-numbers, r=QuietMisdreavuskennytm-5/+8
Add line numbers option to rustdoc Fixes #22878. r? @QuietMisdreavus
2018-10-09Add line numbers option to rustdocGuillaume Gomez-5/+8
2018-09-29Add a sentence before rustc errorsGuillaume Gomez-1/+1
2018-09-29Improve error display for codeblocks in rustdocGuillaume Gomez-7/+18
2018-08-19fix tidy errorsDonato Sciarra-2/+4
2018-08-19mv codemap source_mapDonato Sciarra-5/+5
2018-08-19mv codemap() source_map()Donato Sciarra-2/+2
2018-08-19mv (mod) codemap source_mapDonato Sciarra-1/+1
2018-08-19mv filemap source_fileDonato Sciarra-1/+1
2018-08-19mv CodeMap SourceMapDonato Sciarra-3/+3
2018-08-07Avoid unnecessary pattern matching against Option and Resultljedrz-1/+1