summaryrefslogtreecommitdiff
path: root/src/syntax
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-04-16 22:42:49 +0200
committerLaurenz <laurmaedje@gmail.com>2022-04-16 23:06:47 +0200
commit4494b443bb34fed2208ee3fc87e9a18e7d14b2ab (patch)
tree25a655821b81d10659132fae26861a2aff2d5a95 /src/syntax
parentc5b3f8ee98203191d83d3cfca39bb0f35ee6efc2 (diff)
Ellipsis
Diffstat (limited to 'src/syntax')
-rw-r--r--src/syntax/ast.rs1
-rw-r--r--src/syntax/highlight.rs1
-rw-r--r--src/syntax/mod.rs5
3 files changed, 7 insertions, 0 deletions
diff --git a/src/syntax/ast.rs b/src/syntax/ast.rs
index b01eeb47..60856691 100644
--- a/src/syntax/ast.rs
+++ b/src/syntax/ast.rs
@@ -69,6 +69,7 @@ impl Markup {
NodeKind::Shy => Some(MarkupNode::Text('\u{00AD}'.into())),
NodeKind::EnDash => Some(MarkupNode::Text('\u{2013}'.into())),
NodeKind::EmDash => Some(MarkupNode::Text('\u{2014}'.into())),
+ NodeKind::Ellipsis => Some(MarkupNode::Text('\u{2026}'.into())),
NodeKind::Quote(d) => Some(MarkupNode::Quote(*d)),
NodeKind::Strong => node.cast().map(MarkupNode::Strong),
NodeKind::Emph => node.cast().map(MarkupNode::Emph),
diff --git a/src/syntax/highlight.rs b/src/syntax/highlight.rs
index 34e5b4a7..004ff957 100644
--- a/src/syntax/highlight.rs
+++ b/src/syntax/highlight.rs
@@ -131,6 +131,7 @@ impl Category {
NodeKind::Shy => Some(Category::Shortcut),
NodeKind::EnDash => Some(Category::Shortcut),
NodeKind::EmDash => Some(Category::Shortcut),
+ NodeKind::Ellipsis => Some(Category::Shortcut),
NodeKind::Escape(_) => Some(Category::Escape),
NodeKind::Not => Some(Category::Keyword),
NodeKind::And => Some(Category::Keyword),
diff --git a/src/syntax/mod.rs b/src/syntax/mod.rs
index 1f02217a..d18b6a3d 100644
--- a/src/syntax/mod.rs
+++ b/src/syntax/mod.rs
@@ -599,6 +599,8 @@ pub enum NodeKind {
EnDash,
/// An em-dash: `---`.
EmDash,
+ /// An ellipsis: `...`.
+ Ellipsis,
/// A smart quote: `'` (`false`) or `"` (true).
Quote(bool),
/// A slash and the letter "u" followed by a hexadecimal unicode entity
@@ -774,6 +776,7 @@ impl NodeKind {
| Self::NonBreakingSpace
| Self::EnDash
| Self::EmDash
+ | Self::Ellipsis
| Self::Quote(_)
| Self::Escape(_)
| Self::Strong
@@ -869,6 +872,7 @@ impl NodeKind {
Self::Shy => "soft hyphen",
Self::EnDash => "en dash",
Self::EmDash => "em dash",
+ Self::Ellipsis => "ellipsis",
Self::Quote(false) => "single quote",
Self::Quote(true) => "double quote",
Self::Escape(_) => "escape sequence",
@@ -992,6 +996,7 @@ impl Hash for NodeKind {
Self::Shy => {}
Self::EnDash => {}
Self::EmDash => {}
+ Self::Ellipsis => {}
Self::Quote(d) => d.hash(state),
Self::Escape(c) => c.hash(state),
Self::Strong => {}