feat: tracing is now optional
This commit is contained in:
parent
14d1555fc1
commit
f65e240e92
26 changed files with 184 additions and 45 deletions
|
|
@ -20,16 +20,18 @@ all-features = true
|
|||
default = []
|
||||
indexmap = ["dep:indexmap"]
|
||||
chrono = ["dep:chrono"]
|
||||
tracing = ["dep:tracing"]
|
||||
|
||||
[dependencies]
|
||||
bytecount = "0.6"
|
||||
cfg-if = "1.0.0"
|
||||
chrono = { version = "0.4", optional = true }
|
||||
indexmap = { version = "2.1", optional = true }
|
||||
jetscii = "0.5"
|
||||
memchr = "2.5"
|
||||
nom = { version = "7.1", default-features = false, features = ["std"] }
|
||||
rowan = "0.15"
|
||||
tracing = "0.1"
|
||||
tracing = { version = "0.1", optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
criterion = "0.5"
|
||||
|
|
@ -41,6 +43,10 @@ tracing-subscriber = { version = "0.3", features = ["fmt"] }
|
|||
name = "parse"
|
||||
harness = false
|
||||
|
||||
[[example]]
|
||||
name = "parse"
|
||||
required-features = ["tracing"]
|
||||
|
||||
[profile.dev.package]
|
||||
insta.opt-level = 3
|
||||
similar.opt-level = 3
|
||||
|
|
|
|||
|
|
@ -186,7 +186,10 @@ fn comma_quoted_text_nodes(input: Input) -> Vec<GreenElement> {
|
|||
nodes
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(input), fields(input = input.s))]
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(level = "debug", skip(input), fields(input = input.s))
|
||||
)]
|
||||
pub fn block_node(input: Input) -> IResult<Input, GreenElement, ()> {
|
||||
crate::lossless_parser!(block_node_base, input)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,10 @@ use super::{
|
|||
SyntaxKind,
|
||||
};
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(input), fields(input = input.s))]
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(level = "debug", skip(input), fields(input = input.s))
|
||||
)]
|
||||
pub fn clock_node(input: Input) -> IResult<Input, GreenElement, ()> {
|
||||
let mut parser = map(
|
||||
tuple((
|
||||
|
|
|
|||
|
|
@ -76,7 +76,11 @@ macro_rules! lossless_parser {
|
|||
($parser:expr, $input:expr) => {{
|
||||
let i_ = $input;
|
||||
let (i, o) = $parser($input)?;
|
||||
tracing::trace!(consumed = o.to_string());
|
||||
cfg_if::cfg_if! {
|
||||
if #[cfg(feature = "tracing")] {
|
||||
tracing::trace!(consumed = o.to_string());
|
||||
}
|
||||
}
|
||||
debug_assert_eq!(
|
||||
&i_.as_str()[0..(i_.len() - i.len())],
|
||||
&o.to_string(),
|
||||
|
|
|
|||
|
|
@ -50,7 +50,10 @@ fn comment_node_base(input: Input) -> IResult<Input, GreenElement, ()> {
|
|||
Ok((input, b.finish(SyntaxKind::COMMENT)))
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(input), fields(input = input.s))]
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(level = "debug", skip(input), fields(input = input.s))
|
||||
)]
|
||||
pub fn comment_node(input: Input) -> IResult<Input, GreenElement, ()> {
|
||||
crate::lossless_parser!(comment_node_base, input)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,10 @@ use super::{
|
|||
SyntaxKind::*,
|
||||
};
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(input), fields(input = input.s))]
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(level = "debug", skip(input), fields(input = input.s))
|
||||
)]
|
||||
pub fn cookie_node(input: Input) -> IResult<Input, GreenElement, ()> {
|
||||
let mut parser = map(
|
||||
tuple((
|
||||
|
|
|
|||
|
|
@ -7,7 +7,10 @@ use super::{
|
|||
SyntaxKind::*,
|
||||
};
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(input), fields(input = input.s))]
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(level = "debug", skip(input), fields(input = input.s))
|
||||
)]
|
||||
pub fn document_node(input: Input) -> IResult<Input, GreenElement, ()> {
|
||||
crate::lossless_parser!(document_node_base, input)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -125,13 +125,19 @@ fn node_property_node(input: Input) -> IResult<Input, GreenElement, ()> {
|
|||
)(input)
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(input), fields(input = input.s))]
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(level = "debug", skip(input), fields(input = input.s))
|
||||
)]
|
||||
pub fn property_drawer_node(input: Input) -> IResult<Input, GreenElement, ()> {
|
||||
debug_assert!(!input.is_empty());
|
||||
crate::lossless_parser!(property_drawer_node_base, input)
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(input), fields(input = input.s))]
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(level = "debug", skip(input), fields(input = input.s))
|
||||
)]
|
||||
pub fn drawer_node(input: Input) -> IResult<Input, GreenElement, ()> {
|
||||
crate::lossless_parser!(drawer_node_base, input)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,7 +67,10 @@ fn dyn_block_end_node(input: Input) -> IResult<Input, GreenElement, ()> {
|
|||
Ok((input, b.finish(DYN_BLOCK_END)))
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(input), fields(input = input.s))]
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(level = "debug", skip(input), fields(input = input.s))
|
||||
)]
|
||||
pub fn dyn_block_node(input: Input) -> IResult<Input, GreenElement, ()> {
|
||||
crate::lossless_parser!(dyn_block_node_base, input)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,10 @@ use super::{
|
|||
/// Recognizes multiple org-mode elements
|
||||
///
|
||||
/// input must not contains blank line in the beginning
|
||||
#[tracing::instrument(level = "debug", skip(input), fields(input = input.s))]
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(level = "debug", skip(input), fields(input = input.s))
|
||||
)]
|
||||
pub fn element_nodes(input: Input) -> Result<Vec<GreenElement>, nom::Err<()>> {
|
||||
debug_assert!(!input.is_empty());
|
||||
// TODO:
|
||||
|
|
@ -63,7 +66,10 @@ pub fn element_nodes(input: Input) -> Result<Vec<GreenElement>, nom::Err<()>> {
|
|||
}
|
||||
|
||||
/// Recognizes an org-mode element expect paragraph
|
||||
#[tracing::instrument(level = "debug", skip(input), fields(input = input.s))]
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(level = "debug", skip(input), fields(input = input.s))
|
||||
)]
|
||||
pub fn element_node(input: Input) -> IResult<Input, GreenElement, ()> {
|
||||
// skip affiliated keyword first
|
||||
let (i, nodes) = affiliated_keyword_nodes(input)?;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,10 @@ use super::{
|
|||
SyntaxKind::*,
|
||||
};
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(input), fields(input = input.s))]
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(level = "debug", skip(input), fields(input = input.s))
|
||||
)]
|
||||
pub fn bold_node(input: Input) -> IResult<Input, GreenElement, ()> {
|
||||
let mut parser = map(emphasis(b'*'), |contents| {
|
||||
let mut children = vec![token(STAR, "*")];
|
||||
|
|
@ -20,7 +23,10 @@ pub fn bold_node(input: Input) -> IResult<Input, GreenElement, ()> {
|
|||
crate::lossless_parser!(parser, input)
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(input), fields(input = input.s))]
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(level = "debug", skip(input), fields(input = input.s))
|
||||
)]
|
||||
pub fn code_node(input: Input) -> IResult<Input, GreenElement, ()> {
|
||||
let mut parser = map(emphasis(b'~'), |contents| {
|
||||
node(
|
||||
|
|
@ -31,7 +37,10 @@ pub fn code_node(input: Input) -> IResult<Input, GreenElement, ()> {
|
|||
crate::lossless_parser!(parser, input)
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(input), fields(input = input.s))]
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(level = "debug", skip(input), fields(input = input.s))
|
||||
)]
|
||||
pub fn strike_node(input: Input) -> IResult<Input, GreenElement, ()> {
|
||||
let mut parser = map(emphasis(b'+'), |contents| {
|
||||
let mut children = vec![token(PLUS, "+")];
|
||||
|
|
@ -42,7 +51,10 @@ pub fn strike_node(input: Input) -> IResult<Input, GreenElement, ()> {
|
|||
crate::lossless_parser!(parser, input)
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(input), fields(input = input.s))]
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(level = "debug", skip(input), fields(input = input.s))
|
||||
)]
|
||||
pub fn verbatim_node(input: Input) -> IResult<Input, GreenElement, ()> {
|
||||
let mut parser = map(emphasis(b'='), |contents| {
|
||||
node(
|
||||
|
|
@ -53,7 +65,10 @@ pub fn verbatim_node(input: Input) -> IResult<Input, GreenElement, ()> {
|
|||
crate::lossless_parser!(parser, input)
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(input), fields(input = input.s))]
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(level = "debug", skip(input), fields(input = input.s))
|
||||
)]
|
||||
pub fn underline_node(input: Input) -> IResult<Input, GreenElement, ()> {
|
||||
let mut parser = map(emphasis(b'_'), |contents| {
|
||||
let mut children = vec![token(UNDERSCORE, "_")];
|
||||
|
|
@ -64,7 +79,10 @@ pub fn underline_node(input: Input) -> IResult<Input, GreenElement, ()> {
|
|||
crate::lossless_parser!(parser, input)
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(input), fields(input = input.s))]
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(level = "debug", skip(input), fields(input = input.s))
|
||||
)]
|
||||
pub fn italic_node(input: Input) -> IResult<Input, GreenElement, ()> {
|
||||
let mut parser = map(emphasis(b'/'), |contents| {
|
||||
let mut children = vec![token(SLASH, "/")];
|
||||
|
|
|
|||
|
|
@ -54,7 +54,10 @@ fn fixed_width_node_base(input: Input) -> IResult<Input, GreenElement, ()> {
|
|||
Ok((input, b.finish(SyntaxKind::FIXED_WIDTH)))
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(input), fields(input = input.s))]
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(level = "debug", skip(input), fields(input = input.s))
|
||||
)]
|
||||
pub fn fixed_width_node(input: Input) -> IResult<Input, GreenElement, ()> {
|
||||
crate::lossless_parser!(fixed_width_node_base, input)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,10 @@ use super::{
|
|||
SyntaxKind,
|
||||
};
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(input), fields(input = input.s))]
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(level = "debug", skip(input), fields(input = input.s))
|
||||
)]
|
||||
pub fn fn_def_node(input: Input) -> IResult<Input, GreenElement, ()> {
|
||||
let mut parser = map(
|
||||
tuple((
|
||||
|
|
|
|||
|
|
@ -13,7 +13,10 @@ use super::{
|
|||
SyntaxKind::*,
|
||||
};
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(input), fields(input = input.s))]
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(level = "debug", skip(input), fields(input = input.s))
|
||||
)]
|
||||
pub fn fn_ref_node(input: Input) -> IResult<Input, GreenElement, ()> {
|
||||
crate::lossless_parser!(fn_ref_node_base, input)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,10 @@ use super::{
|
|||
SyntaxKind::*,
|
||||
};
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(input), fields(input = input.s))]
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(level = "debug", skip(input), fields(input = input.s))
|
||||
)]
|
||||
pub fn headline_node(input: Input) -> IResult<Input, GreenElement, ()> {
|
||||
debug_assert!(!input.is_empty());
|
||||
crate::lossless_parser!(headline_node_base, input)
|
||||
|
|
@ -99,7 +102,10 @@ fn headline_node_base(input: Input) -> IResult<Input, GreenElement, ()> {
|
|||
Ok((i, b.finish(HEADLINE)))
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(input), fields(input = input.s))]
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(level = "debug", skip(input), fields(input = input.s))
|
||||
)]
|
||||
pub fn section_node(input: Input) -> IResult<Input, GreenElement, ()> {
|
||||
debug_assert!(!input.is_empty());
|
||||
let (input, section) = section_text(input)?;
|
||||
|
|
@ -120,7 +126,10 @@ fn section_text(input: Input) -> IResult<Input, Input, ()> {
|
|||
Ok(input.take_split(input.len()))
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(input), fields(input = input.s))]
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(level = "debug", skip(input), fields(input = input.s))
|
||||
)]
|
||||
fn headline_stars(input: Input) -> IResult<Input, Input, ()> {
|
||||
let bytes = input.as_bytes();
|
||||
let level = bytes.iter().take_while(|&&c| c == b'*').count();
|
||||
|
|
@ -136,7 +145,10 @@ fn headline_stars(input: Input) -> IResult<Input, Input, ()> {
|
|||
}
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(input), fields(input = input.s))]
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(level = "debug", skip(input), fields(input = input.s))
|
||||
)]
|
||||
fn headline_tags_node(input: Input) -> IResult<Input, GreenElement, ()> {
|
||||
if !input.s.ends_with(':') {
|
||||
return Err(nom::Err::Error(()));
|
||||
|
|
|
|||
|
|
@ -13,7 +13,10 @@ use super::{
|
|||
SyntaxKind,
|
||||
};
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(input), fields(input = input.s))]
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(level = "debug", skip(input), fields(input = input.s))
|
||||
)]
|
||||
pub fn inline_call_node(input: Input) -> IResult<Input, GreenElement, ()> {
|
||||
let mut parser = map(
|
||||
tuple((
|
||||
|
|
|
|||
|
|
@ -13,7 +13,10 @@ use super::{
|
|||
SyntaxKind,
|
||||
};
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(input), fields(input = input.s))]
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(level = "debug", skip(input), fields(input = input.s))
|
||||
)]
|
||||
pub fn inline_src_node(input: Input) -> IResult<Input, GreenElement, ()> {
|
||||
let mut parser = map(
|
||||
tuple((
|
||||
|
|
|
|||
|
|
@ -15,7 +15,10 @@ use super::{
|
|||
SyntaxKind,
|
||||
};
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(input), fields(input = input.s))]
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(level = "debug", skip(input), fields(input = input.s))
|
||||
)]
|
||||
pub fn keyword_node(input: Input) -> IResult<Input, GreenElement, ()> {
|
||||
fn f(input: Input) -> IResult<Input, GreenElement, ()> {
|
||||
let (input, (key, mut nodes)) = keyword_node_base(input)?;
|
||||
|
|
@ -38,7 +41,10 @@ pub fn keyword_node(input: Input) -> IResult<Input, GreenElement, ()> {
|
|||
|
||||
/// Return empty vector if input doesn't contain affiliated keyword, or affiliated keyword is
|
||||
/// followed by blank lines.
|
||||
#[tracing::instrument(level = "debug", skip(input), fields(input = input.s))]
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(level = "debug", skip(input), fields(input = input.s))
|
||||
)]
|
||||
pub fn affiliated_keyword_nodes(input: Input) -> IResult<Input, Vec<GreenElement>, ()> {
|
||||
let mut children = vec![];
|
||||
let mut i = input;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,10 @@ use super::{
|
|||
input::Input,
|
||||
};
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(input), fields(input = input.s))]
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(level = "debug", skip(input), fields(input = input.s))
|
||||
)]
|
||||
pub fn latex_environment_node(input: Input) -> IResult<Input, GreenElement, ()> {
|
||||
crate::lossless_parser!(latex_environment_node_base, input)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,10 @@ use super::{
|
|||
input::Input,
|
||||
};
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(input), fields(input = input.s))]
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(level = "debug", skip(input), fields(input = input.s))
|
||||
)]
|
||||
pub fn latex_fragment_node(input: Input) -> IResult<Input, GreenElement, ()> {
|
||||
debug_assert!(input.s.starts_with(['\\', '$']));
|
||||
let mut parser = alt((template1, template2, template3, template4, template5));
|
||||
|
|
|
|||
|
|
@ -14,7 +14,10 @@ use super::{
|
|||
SyntaxKind::*,
|
||||
};
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(input), fields(input = input.s))]
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(level = "debug", skip(input), fields(input = input.s))
|
||||
)]
|
||||
pub fn link_node(input: Input) -> IResult<Input, GreenElement, ()> {
|
||||
let mut parser = map(
|
||||
tuple((
|
||||
|
|
|
|||
|
|
@ -21,7 +21,10 @@ use super::{
|
|||
SyntaxKind::*,
|
||||
};
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(input), fields(input = input.s))]
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(level = "debug", skip(input), fields(input = input.s))
|
||||
)]
|
||||
pub fn list_node(input: Input) -> IResult<Input, GreenElement, ()> {
|
||||
crate::lossless_parser!(list_node_base, input)
|
||||
}
|
||||
|
|
@ -69,7 +72,10 @@ fn list_node_base(input: Input) -> IResult<Input, GreenElement, ()> {
|
|||
Ok((input, node(LIST, children)))
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(input, indent), fields(input = input.s))]
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(level = "debug", skip(input, indent), fields(input = input.s))
|
||||
)]
|
||||
fn list_item_node<'a>(
|
||||
indent: Input<'a>,
|
||||
input: Input<'a>,
|
||||
|
|
@ -140,7 +146,10 @@ fn list_item_node<'a>(
|
|||
))
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(input), fields(input = input.s))]
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(level = "debug", skip(input), fields(input = input.s))
|
||||
)]
|
||||
fn list_item_counter(input: Input) -> IResult<Input, (GreenElement, Input), ()> {
|
||||
let (input, node) = map(
|
||||
tuple((l_bracket_token, at_token, alphanumeric1, r_bracket_token)),
|
||||
|
|
@ -157,7 +166,10 @@ fn list_item_counter(input: Input) -> IResult<Input, (GreenElement, Input), ()>
|
|||
Ok((input, (node, ws)))
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(input), fields(input = input.s))]
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(level = "debug", skip(input), fields(input = input.s))
|
||||
)]
|
||||
fn list_item_checkbox(input: Input) -> IResult<Input, (GreenElement, Input), ()> {
|
||||
let (input, node) = map(
|
||||
tuple((
|
||||
|
|
@ -180,7 +192,10 @@ fn list_item_checkbox(input: Input) -> IResult<Input, (GreenElement, Input), ()>
|
|||
Ok((input, (node, ws)))
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(input), fields(input = input.s))]
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(level = "debug", skip(input), fields(input = input.s))
|
||||
)]
|
||||
fn list_item_tag(input: Input) -> IResult<Input, (GreenElement, Input), ()> {
|
||||
let bytes = input.as_bytes();
|
||||
|
||||
|
|
@ -197,7 +212,10 @@ fn list_item_tag(input: Input) -> IResult<Input, (GreenElement, Input), ()> {
|
|||
Ok((input, (node(LIST_ITEM_TAG, children), ws)))
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(input), fields(input = input.s))]
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(level = "debug", skip(input), fields(input = input.s))
|
||||
)]
|
||||
fn list_item_content_node(input: Input, indent: usize) -> IResult<Input, (bool, GreenElement), ()> {
|
||||
if memchr(b'\n', input.as_bytes()).is_none() {
|
||||
return Ok((
|
||||
|
|
|
|||
|
|
@ -13,7 +13,10 @@ use super::{
|
|||
SyntaxKind::*,
|
||||
};
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(input), fields(input = input.s))]
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(level = "debug", skip(input), fields(input = input.s))
|
||||
)]
|
||||
pub fn macros_node(input: Input) -> IResult<Input, GreenElement, ()> {
|
||||
let mut parser = map(
|
||||
tuple((
|
||||
|
|
|
|||
|
|
@ -124,12 +124,18 @@ fn table_el_node_base(input: Input) -> IResult<Input, GreenElement, ()> {
|
|||
Ok((input, node(TABLE_EL, children)))
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(input), fields(input = input.s))]
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(level = "debug", skip(input), fields(input = input.s))
|
||||
)]
|
||||
pub fn org_table_node(input: Input) -> IResult<Input, GreenElement, ()> {
|
||||
crate::lossless_parser!(org_table_node_base, input)
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(input), fields(input = input.s))]
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(level = "debug", skip(input), fields(input = input.s))
|
||||
)]
|
||||
pub fn table_el_node(input: Input) -> IResult<Input, GreenElement, ()> {
|
||||
crate::lossless_parser!(table_el_node_base, input)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,10 @@ use super::{
|
|||
SyntaxKind::*,
|
||||
};
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(input), fields(input = input.s))]
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(level = "debug", skip(input), fields(input = input.s))
|
||||
)]
|
||||
pub fn target_node(input: Input) -> IResult<Input, GreenElement, ()> {
|
||||
let mut parser = map(
|
||||
tuple((
|
||||
|
|
|
|||
|
|
@ -17,7 +17,10 @@ use super::{
|
|||
SyntaxKind::*,
|
||||
};
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(input), fields(input = input.s))]
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(level = "debug", skip(input), fields(input = input.s))
|
||||
)]
|
||||
pub fn timestamp_diary_node(input: Input) -> IResult<Input, GreenElement, ()> {
|
||||
let mut parser = map(
|
||||
tuple((
|
||||
|
|
@ -222,7 +225,10 @@ fn timestamp_node_base(
|
|||
}
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(input), fields(input = input.s))]
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(level = "debug", skip(input), fields(input = input.s))
|
||||
)]
|
||||
pub fn timestamp_active_node(input: Input) -> IResult<Input, GreenElement, ()> {
|
||||
fn parser(input: Input) -> IResult<Input, GreenElement, ()> {
|
||||
let (input, children) = timestamp_node_base(input, l_angle_token, r_angle_token)?;
|
||||
|
|
@ -231,7 +237,10 @@ pub fn timestamp_active_node(input: Input) -> IResult<Input, GreenElement, ()> {
|
|||
crate::lossless_parser!(parser, input)
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(input), fields(input = input.s))]
|
||||
#[cfg_attr(
|
||||
feature = "tracing",
|
||||
tracing::instrument(level = "debug", skip(input), fields(input = input.s))
|
||||
)]
|
||||
pub fn timestamp_inactive_node(input: Input) -> IResult<Input, GreenElement, ()> {
|
||||
fn parser(input: Input) -> IResult<Input, GreenElement, ()> {
|
||||
let (input, children) = timestamp_node_base(input, l_bracket_token, r_bracket_token)?;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue