summaryrefslogtreecommitdiff
path: root/src/syntax/ast.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-08-30 15:00:18 +0200
committerLaurenz <laurmaedje@gmail.com>2022-09-07 11:07:17 +0200
commit0d12f2ab23177642eef2e6bb9c583cdd0c743b33 (patch)
tree03a88594081dcf360d0d880167feb1debca970e6 /src/syntax/ast.rs
parent0cb876ebf9138c1ee3b3c87165952a73569ffb28 (diff)
[WIP] Label and reference syntax
Diffstat (limited to 'src/syntax/ast.rs')
-rw-r--r--src/syntax/ast.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/syntax/ast.rs b/src/syntax/ast.rs
index 67f9e038..10bee4e8 100644
--- a/src/syntax/ast.rs
+++ b/src/syntax/ast.rs
@@ -84,6 +84,8 @@ impl Markup {
NodeKind::Heading => node.cast().map(MarkupNode::Heading),
NodeKind::List => node.cast().map(MarkupNode::List),
NodeKind::Enum => node.cast().map(MarkupNode::Enum),
+ NodeKind::Label(v) => Some(MarkupNode::Label(v.clone())),
+ NodeKind::Ref(v) => Some(MarkupNode::Ref(v.clone())),
_ => node.cast().map(MarkupNode::Expr),
})
}
@@ -116,6 +118,10 @@ pub enum MarkupNode {
List(ListNode),
/// An item in an enumeration (ordered list): `1. ...`.
Enum(EnumNode),
+ /// A label.
+ Label(EcoString),
+ /// A reference.
+ Ref(EcoString),
/// An expression.
Expr(Expr),
}