From 5de791d9e6a1006dc6a017ec8e20a1c70a91a780 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Wed, 15 Sep 2021 12:43:57 +0200 Subject: Rename `SyntaxTree` to `Markup` Also `SyntaxNode` -> `MarkupNode`. --- src/syntax/node.rs | 74 ------------------------------------------------------ 1 file changed, 74 deletions(-) delete mode 100644 src/syntax/node.rs (limited to 'src/syntax/node.rs') diff --git a/src/syntax/node.rs b/src/syntax/node.rs deleted file mode 100644 index 875d32f5..00000000 --- a/src/syntax/node.rs +++ /dev/null @@ -1,74 +0,0 @@ -use super::*; - -/// A syntax node, encompassing a single logical entity of parsed source code. -#[derive(Debug, Clone, PartialEq)] -pub enum SyntaxNode { - /// Whitespace containing less than two newlines. - Space, - /// A forced line break: `\`. - Linebreak(Span), - /// A paragraph break: Two or more newlines. - Parbreak(Span), - /// Strong text was enabled / disabled: `*`. - Strong(Span), - /// Emphasized text was enabled / disabled: `_`. - Emph(Span), - /// Plain text. - Text(EcoString), - /// A raw block with optional syntax highlighting: `` `...` ``. - Raw(Box), - /// A section heading: `= Introduction`. - Heading(Box), - /// An item in an unordered list: `- ...`. - List(Box), - /// An item in an enumeration (ordered list): `1. ...`. - Enum(Box), - /// An expression. - Expr(Expr), -} - -/// A raw block with optional syntax highlighting: `` `...` ``. -#[derive(Debug, Clone, PartialEq)] -pub struct RawNode { - /// The source code location. - pub span: Span, - /// An optional identifier specifying the language to syntax-highlight in. - pub lang: Option, - /// The raw text, determined as the raw string between the backticks trimmed - /// according to the above rules. - pub text: EcoString, - /// Whether the element is block-level, that is, it has 3+ backticks - /// and contains at least one newline. - pub block: bool, -} - -/// A section heading: `= Introduction`. -#[derive(Debug, Clone, PartialEq)] -pub struct HeadingNode { - /// The source code location. - pub span: Span, - /// The section depth (numer of equals signs). - pub level: usize, - /// The contents of the heading. - pub body: SyntaxTree, -} - -/// An item in an unordered list: `- ...`. -#[derive(Debug, Clone, PartialEq)] -pub struct ListNode { - /// The source code location. - pub span: Span, - /// The contents of the list item. - pub body: SyntaxTree, -} - -/// An item in an enumeration (ordered list): `1. ...`. -#[derive(Debug, Clone, PartialEq)] -pub struct EnumNode { - /// The source code location. - pub span: Span, - /// The number, if any. - pub number: Option, - /// The contents of the list item. - pub body: SyntaxTree, -} -- cgit v1.2.3