Compare commits

..

No commits in common. "ee92049e5d342cb2b19c22b5cfc82f10a1347156" and "67f79aeb51b925d53600f0ecebf0a5294c4f7d5f" have entirely different histories.

5 changed files with 7 additions and 42 deletions

View File

@ -1,18 +0,0 @@
#+begin_defun
foo
#+begin_lorem
,#+begin_center
bar
,#+end_center
ipsum
#+end_lorem
baz
#+end_defun
#+begin_center
#+begin_quote
#+begin_center
lorem
#+end_center
#+end_quote
#+end_center

View File

@ -1,12 +0,0 @@
#+begin_defun
foo
#+begin_lorem
ipsum
#+end_lorem
bar
#+begin_center
#+begin_quote
baz
#+end_quote
#+end_center
#+end_defun

View File

@ -1,5 +0,0 @@
#+begin_defun
foo
{{{bar(baz)}}}
#+end_defun

View File

@ -737,7 +737,7 @@ fn compare_greater_block<'s>(
let emacs_name = match rust.name.to_lowercase().as_str() { let emacs_name = match rust.name.to_lowercase().as_str() {
"center" => "center-block", "center" => "center-block",
"quote" => "quote-block", "quote" => "quote-block",
_ => "special-block", _ => todo!(),
}; };
if assert_name(emacs, emacs_name).is_err() { if assert_name(emacs, emacs_name).is_err() {
this_status = DiffStatus::Bad; this_status = DiffStatus::Bad;

View File

@ -12,7 +12,6 @@ use nom::multi::many_till;
use nom::sequence::tuple; use nom::sequence::tuple;
use super::org_source::OrgSource; use super::org_source::OrgSource;
use super::util::in_section;
use super::Context; use super::Context;
use crate::error::CustomError; use crate::error::CustomError;
use crate::error::MyError; use crate::error::MyError;
@ -27,6 +26,7 @@ use crate::parser::source::SetSource;
use crate::parser::util::blank_line; use crate::parser::util::blank_line;
use crate::parser::util::exit_matcher_parser; use crate::parser::util::exit_matcher_parser;
use crate::parser::util::get_consumed; use crate::parser::util::get_consumed;
use crate::parser::util::immediate_in_section;
use crate::parser::util::start_of_line; use crate::parser::util::start_of_line;
use crate::parser::Element; use crate::parser::Element;
use crate::parser::Paragraph; use crate::parser::Paragraph;
@ -49,11 +49,11 @@ pub fn greater_block<'r, 's>(
}), }),
))(remaining)?; ))(remaining)?;
let context_name = match Into::<&str>::into(name).to_lowercase().as_str() { let context_name = match Into::<&str>::into(name).to_lowercase().as_str() {
"center" => "center block".to_owned(), "center" => "center block",
"quote" => "quote block".to_owned(), "quote" => "quote block",
name @ _ => format!("special block {}", name), _ => "greater block",
}; };
if in_section(context, context_name.as_str()) { if immediate_in_section(context, context_name) {
return Err(nom::Err::Error(CustomError::MyError(MyError( return Err(nom::Err::Error(CustomError::MyError(MyError(
"Cannot nest objects of the same element".into(), "Cannot nest objects of the same element".into(),
)))); ))));
@ -63,7 +63,7 @@ pub fn greater_block<'r, 's>(
let (remaining, _nl) = line_ending(remaining)?; let (remaining, _nl) = line_ending(remaining)?;
let parser_context = context let parser_context = context
.with_additional_node(ContextElement::ConsumeTrailingWhitespace(true)) .with_additional_node(ContextElement::ConsumeTrailingWhitespace(true))
.with_additional_node(ContextElement::Context(context_name.as_str())) .with_additional_node(ContextElement::Context(context_name))
.with_additional_node(ContextElement::ExitMatcherNode(ExitMatcherNode { .with_additional_node(ContextElement::ExitMatcherNode(ExitMatcherNode {
class: ExitClass::Alpha, class: ExitClass::Alpha,
exit_matcher: &exit_with_name, exit_matcher: &exit_with_name,