Skip to content

Commit

Permalink
fix: make stage3 constructs usable outside the lib
Browse files Browse the repository at this point in the history
  • Loading branch information
vhyrro committed Aug 14, 2024
1 parent 07fd9c3 commit d89c701
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
6 changes: 1 addition & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@ use error::NorgParseError;

use crate::stage_1::stage_1;
use crate::stage_2::stage_2;
use crate::stage_3::stage_3;

pub use crate::stage_2::ParagraphSegmentToken;
pub use crate::stage_3::{
CarryoverTag, DetachedModifierExtension, NestableDetachedModifier, NorgASTFlat,
RangeableDetachedModifier, RangedTag, TodoStatus,
};
pub use crate::stage_3::*;

mod error;
mod stage_1;
Expand Down
12 changes: 6 additions & 6 deletions src/stage_3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ use serde::Serialize;

use crate::stage_2::{NorgBlock, ParagraphSegmentToken, ParagraphTokenList};

#[derive(Debug, PartialEq, Serialize)]
#[derive(Clone, Hash, Debug, PartialEq, Eq, Serialize)]
pub enum NestableDetachedModifier {
Quote,
UnorderedList,
OrderedList,
}

#[derive(Debug, PartialEq, Serialize)]
#[derive(Clone, Hash, Debug, PartialEq, Eq, Serialize)]
pub enum RangeableDetachedModifier {
Definition,
Footnote,
Table,
}

#[derive(Debug, PartialEq, Serialize)]
#[derive(Clone, Hash, Debug, PartialEq, Eq, Serialize)]
pub enum TodoStatus {
/// ` `
Undone,
Expand All @@ -38,7 +38,7 @@ pub enum TodoStatus {
Canceled,
}

#[derive(Debug, PartialEq, Serialize)]
#[derive(Clone, Hash, Debug, PartialEq, Eq, Serialize)]
pub enum DetachedModifierExtension {
/// todo item status:
/// `- ( ) undone`
Expand Down Expand Up @@ -69,7 +69,7 @@ pub enum DetachedModifierExtension {
StartDate(String),
}

#[derive(Debug, PartialEq, Serialize)]
#[derive(Clone, Hash, Debug, PartialEq, Eq, Serialize)]
pub enum CarryoverTag {
Attribute, // `+`
Macro, // `#`
Expand Down Expand Up @@ -468,7 +468,7 @@ fn parse_paragraph(
)))
}

#[derive(Debug, PartialEq, Serialize)]
#[derive(Clone, Debug, PartialEq, Hash, Eq, Serialize)]
pub enum NorgASTFlat {
Paragraph(Vec<ParagraphSegment>),
NestableDetachedModifier {
Expand Down

0 comments on commit d89c701

Please sign in to comment.