From 26e0ad58004a6b9194fc000ae7fc4e95ce554d47 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Sat, 15 Apr 2023 16:34:33 -0400 Subject: [PATCH] Add an example exploring indentation with comments. --- org_mode_samples/comment/indented.org | 5 +++++ src/parser/comment.rs | 9 +++++++++ 2 files changed, 14 insertions(+) create mode 100644 org_mode_samples/comment/indented.org diff --git a/org_mode_samples/comment/indented.org b/org_mode_samples/comment/indented.org new file mode 100644 index 0000000..4360a35 --- /dev/null +++ b/org_mode_samples/comment/indented.org @@ -0,0 +1,5 @@ +# Comment + # indented line +# At the top of the file +foo +# Another comment diff --git a/src/parser/comment.rs b/src/parser/comment.rs index 8b13789..8152259 100644 --- a/src/parser/comment.rs +++ b/src/parser/comment.rs @@ -1 +1,10 @@ +use super::Context; +use crate::parser::error::Res; +use crate::parser::util::start_of_line; +use crate::parser::Comment; +#[tracing::instrument(ret, level = "debug")] +pub fn comment<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<&'s str, Comment<'s>> { + start_of_line(context, input)?; + todo!() +}