diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-06-11 14:00:06 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-06-11 14:00:06 +0200 |
| commit | 4dbd9285c91d59d527f4324df4aaf239ecb007ca (patch) | |
| tree | 561a9a18a1eea6a2e598157f305667c4ea8e3e08 /src/syntax/node.rs | |
| parent | 3330767c20e14a05176902a93dcefb08cb509173 (diff) | |
Basic enums
Diffstat (limited to 'src/syntax/node.rs')
| -rw-r--r-- | src/syntax/node.rs | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/syntax/node.rs b/src/syntax/node.rs index b4684d0b..a97430b6 100644 --- a/src/syntax/node.rs +++ b/src/syntax/node.rs @@ -21,8 +21,10 @@ pub enum Node { Raw(RawNode), /// A section heading: `= Introduction`. Heading(HeadingNode), - /// A single list item: `- ...`. - List(ListNode), + /// An item in an unordered list: `- ...`. + List(ListItem), + /// An item in an enumeration (ordered list): `1. ...`. + Enum(EnumItem), /// An expression. Expr(Expr), } @@ -115,11 +117,22 @@ pub struct HeadingNode { pub body: Rc<Tree>, } -/// A single list item: `- ...`. +/// An item in an unordered list: `- ...`. #[derive(Debug, Clone, PartialEq)] -pub struct ListNode { +pub struct ListItem { /// The source code location. pub span: Span, /// The contents of the list item. pub body: Tree, } + +/// An item in an enumeration (ordered list): `1. ...`. +#[derive(Debug, Clone, PartialEq)] +pub struct EnumItem { + /// The source code location. + pub span: Span, + /// The number, if any. + pub number: Option<usize>, + /// The contents of the list item. + pub body: Tree, +} |
