Switch to RefContext.

This commit is contained in:
Tom Alexander
2023-09-02 19:16:44 -04:00
parent 12ad3b09f0
commit 564104f1e8
41 changed files with 200 additions and 200 deletions

View File

@@ -36,7 +36,7 @@ use crate::parser::Verbatim;
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
pub fn text_markup<'r, 's>(
context: Context<'r, 's>,
context: RefContext<'r, 's>,
input: OrgSource<'s>,
) -> Res<OrgSource<'s>, Object<'s>> {
alt((
@@ -54,7 +54,7 @@ pub fn text_markup<'r, 's>(
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
pub fn bold<'r, 's>(
context: Context<'r, 's>,
context: RefContext<'r, 's>,
input: OrgSource<'s>,
) -> Res<OrgSource<'s>, Bold<'s>> {
let text_markup_object_specialized = text_markup_object("*");
@@ -71,7 +71,7 @@ pub fn bold<'r, 's>(
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
pub fn italic<'r, 's>(
context: Context<'r, 's>,
context: RefContext<'r, 's>,
input: OrgSource<'s>,
) -> Res<OrgSource<'s>, Italic<'s>> {
let text_markup_object_specialized = text_markup_object("/");
@@ -88,7 +88,7 @@ pub fn italic<'r, 's>(
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
pub fn underline<'r, 's>(
context: Context<'r, 's>,
context: RefContext<'r, 's>,
input: OrgSource<'s>,
) -> Res<OrgSource<'s>, Underline<'s>> {
let text_markup_object_specialized = text_markup_object("_");
@@ -105,7 +105,7 @@ pub fn underline<'r, 's>(
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
pub fn strike_through<'r, 's>(
context: Context<'r, 's>,
context: RefContext<'r, 's>,
input: OrgSource<'s>,
) -> Res<OrgSource<'s>, StrikeThrough<'s>> {
let text_markup_object_specialized = text_markup_object("+");
@@ -122,7 +122,7 @@ pub fn strike_through<'r, 's>(
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
pub fn verbatim<'r, 's>(
context: Context<'r, 's>,
context: RefContext<'r, 's>,
input: OrgSource<'s>,
) -> Res<OrgSource<'s>, Verbatim<'s>> {
let text_markup_string_specialized = text_markup_string("=");
@@ -139,7 +139,7 @@ pub fn verbatim<'r, 's>(
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
pub fn code<'r, 's>(
context: Context<'r, 's>,
context: RefContext<'r, 's>,
input: OrgSource<'s>,
) -> Res<OrgSource<'s>, Code<'s>> {
let text_markup_string_specialized = text_markup_string("~");
@@ -165,7 +165,7 @@ fn text_markup_object(
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
fn _text_markup_object<'r, 's, 'x>(
context: Context<'r, 's>,
context: RefContext<'r, 's>,
input: OrgSource<'s>,
marker_symbol: &'x str,
) -> Res<OrgSource<'s>, Vec<Object<'s>>> {
@@ -216,7 +216,7 @@ fn text_markup_string(
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
fn _text_markup_string<'r, 's, 'x>(
context: Context<'r, 's>,
context: RefContext<'r, 's>,
input: OrgSource<'s>,
marker_symbol: &'x str,
) -> Res<OrgSource<'s>, OrgSource<'s>> {
@@ -257,7 +257,7 @@ fn _text_markup_string<'r, 's, 'x>(
}
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
pub fn pre<'r, 's>(_context: Context<'r, 's>, input: OrgSource<'s>) -> Res<OrgSource<'s>, ()> {
pub fn pre<'r, 's>(_context: RefContext<'r, 's>, input: OrgSource<'s>) -> Res<OrgSource<'s>, ()> {
let preceding_character = input.get_preceding_character();
match preceding_character {
// If None, we are at the start of the file which is technically the beginning of a line.
@@ -274,7 +274,7 @@ pub fn pre<'r, 's>(_context: Context<'r, 's>, input: OrgSource<'s>) -> Res<OrgSo
}
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
pub fn post<'r, 's>(_context: Context<'r, 's>, input: OrgSource<'s>) -> Res<OrgSource<'s>, ()> {
pub fn post<'r, 's>(_context: RefContext<'r, 's>, input: OrgSource<'s>) -> Res<OrgSource<'s>, ()> {
let (remaining, _) = alt((recognize(one_of(" \r\n\t-.,;:!?')}[\"")), line_ending))(input)?;
Ok((remaining, ()))
}
@@ -290,7 +290,7 @@ fn text_markup_end(
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
fn _text_markup_end<'r, 's, 'x>(
context: Context<'r, 's>,
context: RefContext<'r, 's>,
input: OrgSource<'s>,
marker_symbol: &'x str,
) -> Res<OrgSource<'s>, OrgSource<'s>> {
@@ -307,7 +307,7 @@ impl<'x> RematchObject<'x> for Bold<'x> {
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
fn rematch_object<'r, 's>(
&'x self,
_context: Context<'r, 's>,
_context: RefContext<'r, 's>,
input: OrgSource<'s>,
) -> Res<OrgSource<'s>, Object<'s>> {
let (remaining, children) =
@@ -325,7 +325,7 @@ impl<'x> RematchObject<'x> for Bold<'x> {
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
fn _rematch_text_markup_object<'r, 's, 'x>(
context: Context<'r, 's>,
context: RefContext<'r, 's>,
input: OrgSource<'s>,
marker_symbol: &'static str,
original_match_children: &'x Vec<Object<'x>>,