feat: tracing is now optional

This commit is contained in:
PoiScript 2024-03-06 15:42:32 +08:00
parent 14d1555fc1
commit f65e240e92
No known key found for this signature in database
GPG key ID: 22C2B1249D99985E
26 changed files with 184 additions and 45 deletions

View file

@ -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;