1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
//! This module defines the diagnostic conditions that the [`quote`](super)
//! feature reports (see
//! [diagnostics](crate::guide::concepts_overview#diagnostics)). All three
//! conditions are errors in the source of a quotation.
//!
//! The lowering rules of the feature report these errors on every backend.
//! The `check` workflow ([`CHECK_WORKFLOW`](crate::stdlib::CHECK_WORKFLOW))
//! lowers nothing, and therefore does not report them.
use DiagnosticInfo;
/// The error that is reported when a quote environment such as `quote`
/// contains content outside its quotation-section commands (id
/// `flm.quote.bare-content`).
///
/// The configuration of a quote environment
/// ([`QuoteEnvironment`](super::QuoteEnvironment)) declares the
/// quotation-section commands (`\text`, `\lines`, `\attributed` and `\block`)
/// that its body accepts. It can also declare a kind of quotation section for
/// the content written outside these commands
/// ([`bare`](super::QuoteEnvironment::bare)). If it declares none, as for the
/// default environment `quote`, all content must be written inside the
/// accepted commands, as in
/// `\begin{quote}\text{Veni, vidi, vici.}\attributed{Caesar}\end{quote}`.
/// Whitespace and comments outside the commands are allowed.
///
/// Reported by the lowering rule of the quote environment
/// ([`QuoteRule`](super::QuoteRule), or
/// [`QuoteLatexRule`](super::latex::QuoteLatexRule) on the `latex-recomposed`
/// backend) when it is invoked. The error is reported once for each run of
/// content outside the commands: all the content between two
/// quotation-section commands, or before the first, or after the last. This
/// content is otherwise written as usual, at its place in the quotation and
/// outside any quotation section.
/// Error raised when a quotation-section command is not written directly in
/// the body of a quote environment (`flm.quote.nested-section`).
///
/// A quotation-section command (`\text`, `\lines`, `\attributed` or `\block`)
/// starts a quotation section. It must be written directly in the body of a
/// quote environment, as in
/// `\begin{quote}\text{Veni, vidi, vici.}\attributed{Caesar}\end{quote}`.
///
/// Reported by the lowering rule of the quotation-section commands
/// ([`SectionRule`](super::SectionRule)) when it is invoked. The command
/// expands to the content of its argument. For a `\lines` command, the `\\`
/// and `\indent` commands in the argument are left out.
/// Error raised when an `\indent` command is not written at the start of a
/// line (`flm.quote.indent-mid-line`).
///
/// A lines section of a quotation is the argument of a `\lines` command, or
/// the body of a quote environment whose content is read as lines, such as
/// `address`. In a lines section, each `\indent` command at the start of a
/// line indents the line by one tab, as in
/// `\lines{First line\\ \indent Second line}`. The `\indent` commands of a
/// line must come before all other content of the line.
///
/// Reported by the lowering rule of the quote environment
/// ([`QuoteRule`](super::QuoteRule), or
/// [`QuoteLatexRule`](super::latex::QuoteLatexRule) on the `latex-recomposed`
/// backend) when it is invoked. The `\indent` command is left out. The line
/// is otherwise written as usual, indented by the `\indent` commands at its
/// start.
;