Started switching over to a stack-based context tree with global settings.
This change should hopefully allow for matchers to have captured borrowed values, it should eliminate the use of heap-allocated reference counting on the context nodes, and it adds in a global settings struct for passing around values that do not change during parsing.
This commit is contained in:
@@ -110,4 +110,14 @@ pub use object::Timestamp;
|
||||
pub use object::Underline;
|
||||
pub use object::Verbatim;
|
||||
pub use source::Source;
|
||||
type Context<'r, 's> = &'r parser_context::ContextTree<'r, 's>;
|
||||
|
||||
use self::org_source::OrgSource;
|
||||
use self::parser_context::Context;
|
||||
use crate::error::Res;
|
||||
|
||||
type RefContext<'r, 's> = &'r Context<'r, 's>;
|
||||
trait ContextMatcher =
|
||||
for<'r, 's> Fn(RefContext<'r, 's>, OrgSource<'s>) -> Res<OrgSource<'s>, OrgSource<'s>>;
|
||||
type DynContextMatcher<'c> = dyn ContextMatcher + 'c;
|
||||
trait Matcher = for<'s> Fn(OrgSource<'s>) -> Res<OrgSource<'s>, OrgSource<'s>>;
|
||||
type DynMatcher<'c> = dyn Matcher + 'c;
|
||||
|
||||
Reference in New Issue
Block a user