2016-06-21 17:08:13 -05:00
|
|
|
[package]
|
|
|
|
name = "rustc_errors"
|
|
|
|
version = "0.0.0"
|
2021-09-19 11:49:55 -05:00
|
|
|
edition = "2021"
|
2016-06-21 17:08:13 -05:00
|
|
|
|
|
|
|
[lib]
|
|
|
|
|
|
|
|
[dependencies]
|
2020-08-14 01:05:01 -05:00
|
|
|
tracing = "0.1"
|
2022-09-14 12:22:20 -05:00
|
|
|
rustc_ast = { path = "../rustc_ast" }
|
|
|
|
rustc_ast_pretty = { path = "../rustc_ast_pretty" }
|
2022-03-23 21:03:04 -05:00
|
|
|
rustc_error_messages = { path = "../rustc_error_messages" }
|
2023-04-16 07:33:00 -05:00
|
|
|
rustc_fluent_macro = { path = "../rustc_fluent_macro" }
|
2020-08-27 22:58:48 -05:00
|
|
|
rustc_serialize = { path = "../rustc_serialize" }
|
|
|
|
rustc_span = { path = "../rustc_span" }
|
|
|
|
rustc_macros = { path = "../rustc_macros" }
|
|
|
|
rustc_data_structures = { path = "../rustc_data_structures" }
|
2022-09-01 01:03:47 -05:00
|
|
|
rustc_target = { path = "../rustc_target" }
|
2022-06-29 00:09:59 -05:00
|
|
|
rustc_hir = { path = "../rustc_hir" }
|
2020-08-13 14:41:52 -05:00
|
|
|
rustc_lint_defs = { path = "../rustc_lint_defs" }
|
2022-11-17 07:53:14 -06:00
|
|
|
rustc_type_ir = { path = "../rustc_type_ir" }
|
2017-12-11 01:35:53 -06:00
|
|
|
unicode-width = "0.1.4"
|
Add a simple markdown parser for formatting `rustc --explain`
Currently, the output of `rustc --explain foo` displays the raw markdown in a
pager. This is acceptable, but using actual formatting makes it easier to
understand.
This patch consists of three major components:
1. A markdown parser. This is an extremely simple non-backtracking recursive
implementation that requires normalization of the final token stream
2. A utility to write the token stream to an output buffer
3. Configuration within rustc_driver_impl to invoke this combination for
`--explain`. Like the current implementation, it first attempts to print to
a pager with a fallback colorized terminal, and standard print as a last
resort.
If color is disabled, or if the output does not support it, or if printing
with color fails, it will write the raw markdown (which matches current
behavior).
Pagers known to support color are: `less` (with `-r`), `bat` (aka `catbat`),
and `delta`.
The markdown parser does not support the entire markdown specification, but
should support the following with reasonable accuracy:
- Headings, including formatting
- Comments
- Code, inline and fenced block (no indented block)
- Strong, emphasis, and strikethrough formatted text
- Links, anchor, inline, and reference-style
- Horizontal rules
- Unordered and ordered list items, including formatting
This parser and writer should be reusable by other systems if ever needed.
2022-12-19 12:09:40 -06:00
|
|
|
termcolor = "1.2.0"
|
2022-07-31 08:44:06 -05:00
|
|
|
annotate-snippets = "0.9"
|
2020-01-28 18:13:48 -06:00
|
|
|
termize = "0.1.1"
|
2022-08-26 15:39:59 -05:00
|
|
|
serde = { version = "1.0.125", features = [ "derive" ] }
|
2021-06-03 14:14:15 -05:00
|
|
|
serde_json = "1.0.59"
|
2023-07-25 08:09:53 -05:00
|
|
|
derive_setters = "0.1.6"
|
2020-01-04 15:46:47 -06:00
|
|
|
|
2023-01-15 12:43:15 -06:00
|
|
|
[target.'cfg(windows)'.dependencies.windows]
|
2023-05-09 10:20:13 -05:00
|
|
|
version = "0.48.0"
|
2023-01-15 12:43:15 -06:00
|
|
|
features = [
|
|
|
|
"Win32_Foundation",
|
|
|
|
"Win32_Security",
|
|
|
|
"Win32_System_Threading",
|
|
|
|
]
|
2022-11-06 11:25:48 -06:00
|
|
|
|
|
|
|
[features]
|
|
|
|
rustc_use_parallel_compiler = ['rustc_error_messages/rustc_use_parallel_compiler']
|