summaryrefslogtreecommitdiff
path: root/src/syntax/mod.rs
diff options
context:
space:
mode:
authorMartin Haug <mhaug@live.de>2022-04-12 13:00:34 +0200
committerLaurenz <laurmaedje@gmail.com>2022-04-12 22:35:04 +0200
commit072543fc59582eacfd9446055639c4427e707941 (patch)
tree37cdefe123e24f1342fad0b385615d1e2e04a350 /src/syntax/mod.rs
parentc3a387b8f7086fc6d58a4175e8408fbbf375f5f2 (diff)
Introduce `NodeKind::Quote`
Diffstat (limited to 'src/syntax/mod.rs')
-rw-r--r--src/syntax/mod.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/syntax/mod.rs b/src/syntax/mod.rs
index 5857940c..f0d3cdd4 100644
--- a/src/syntax/mod.rs
+++ b/src/syntax/mod.rs
@@ -596,6 +596,8 @@ pub enum NodeKind {
EnDash,
/// An em-dash: `---`.
EmDash,
+ /// A smart quote: `'` (`false`) or `"` (true).
+ Quote(bool),
/// A slash and the letter "u" followed by a hexadecimal unicode entity
/// enclosed in curly braces: `\u{1F5FA}`.
Escape(char),
@@ -769,6 +771,7 @@ impl NodeKind {
| Self::NonBreakingSpace
| Self::EnDash
| Self::EmDash
+ | Self::Quote(_)
| Self::Escape(_)
| Self::Strong
| Self::Emph
@@ -861,6 +864,8 @@ impl NodeKind {
Self::NonBreakingSpace => "non-breaking space",
Self::EnDash => "en dash",
Self::EmDash => "em dash",
+ Self::Quote(false) => "single quote",
+ Self::Quote(true) => "double quote",
Self::Escape(_) => "escape sequence",
Self::Strong => "strong content",
Self::Emph => "emphasized content",
@@ -981,6 +986,7 @@ impl Hash for NodeKind {
Self::NonBreakingSpace => {}
Self::EnDash => {}
Self::EmDash => {}
+ Self::Quote(d) => d.hash(state),
Self::Escape(c) => c.hash(state),
Self::Strong => {}
Self::Emph => {}