summaryrefslogtreecommitdiff
path: root/src/syntax/mod.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/mod.rs
parent0cb876ebf9138c1ee3b3c87165952a73569ffb28 (diff)
[WIP] Label and reference syntax
Diffstat (limited to 'src/syntax/mod.rs')
-rw-r--r--src/syntax/mod.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/syntax/mod.rs b/src/syntax/mod.rs
index 4bae7a4b..eb070a04 100644
--- a/src/syntax/mod.rs
+++ b/src/syntax/mod.rs
@@ -723,6 +723,10 @@ pub enum NodeKind {
///
/// Can also exist without the number: `.`.
EnumNumbering(Option<usize>),
+ /// A label: `<label>`.
+ Label(EcoString),
+ /// A reference: `@label`.
+ Ref(EcoString),
/// An identifier: `center`.
Ident(EcoString),
/// A boolean: `true`, `false`.
@@ -935,6 +939,8 @@ impl NodeKind {
Self::Heading => "heading",
Self::Enum => "enumeration item",
Self::EnumNumbering(_) => "enumeration item numbering",
+ Self::Label(_) => "label",
+ Self::Ref(_) => "reference",
Self::Ident(_) => "identifier",
Self::Bool(_) => "boolean",
Self::Int(_) => "integer",
@@ -1060,6 +1066,8 @@ impl Hash for NodeKind {
Self::Heading => {}
Self::Enum => {}
Self::EnumNumbering(num) => num.hash(state),
+ Self::Label(c) => c.hash(state),
+ Self::Ref(c) => c.hash(state),
Self::Ident(v) => v.hash(state),
Self::Bool(v) => v.hash(state),
Self::Int(v) => v.hash(state),