summary refs log tree commit diff
path: root/src/librustdoc/html/highlight
AgeCommit message (Collapse)AuthorLines
2020-11-16Add test to ensure that no DOS backline (\r\n) doesn't create extra backline ↵Guillaume Gomez-11/+24
in source rendering
2020-08-31Update expect-test to 1.0Aleksey Kladov-1/+1
The only change is that `expect_file` now uses path relative to the current file (same as `include!`). Before, it used paths relative to the workspace root, which makes no sense.
2020-08-27Add expect test for rustdoc html highlightingAleksey Kladov-61/+63
It's a unit-test in a sense that it only checks syntax highlighting. However, the resulting HTML is written to disk and can be easily inspected in the browser. To update the test, run with `--bless` argument or set `UPDATE_EXPEC=1` env var
2020-08-27Remove dependency on StringReader from rustdoc highlighterAleksey Kladov-20/+4
rustc_lexer is the lossless lexer, which is a better fit for approximate syntax highlighting. As a side-effect, we can now syntax-highlight even broken code.
2020-08-08Eliminate the `SessionGlobals` from `librustc_ast`.Nicholas Nethercote-1/+1
By moving `{known,used}_attrs` from `SessionGlobals` to `Session`. This means they are accessed via the `Session`, rather than via TLS. A few `Attr` methods and `librustc_ast` functions are now methods of `Session`. All of this required passing a `Session` to lots of functions that didn't already have one. Some of these functions also had arguments removed, because those arguments could be accessed directly via the `Session` argument. `contains_feature_attr()` was dead, and is removed. Some functions were moved from `librustc_ast` elsewhere because they now need to access `Session`, which isn't available in that crate. - `entry_point_type()` --> `librustc_builtin_macros` - `global_allocator_spans()` --> `librustc_metadata` - `is_proc_macro_attr()` --> `Session`
2020-07-14rustdoc: glue tokens before highlightingAndy Russell-0/+82
Fixes #72684. This commit also modifies the signature of `Classifier::new` to avoid copying the source being highlighted.