Just doing a simple match everything for path reg.
This commit is contained in:
		
							parent
							
								
									8a828195bd
								
							
						
					
					
						commit
						b4d4453186
					
				@ -1,7 +1,14 @@
 | 
			
		||||
use nom::branch::alt;
 | 
			
		||||
use nom::bytes::complete::escaped;
 | 
			
		||||
use nom::bytes::complete::tag;
 | 
			
		||||
use nom::bytes::complete::take_till1;
 | 
			
		||||
use nom::character::complete::line_ending;
 | 
			
		||||
use nom::character::complete::one_of;
 | 
			
		||||
use nom::character::complete::space0;
 | 
			
		||||
use nom::combinator::opt;
 | 
			
		||||
use nom::combinator::verify;
 | 
			
		||||
use nom::multi::many_till;
 | 
			
		||||
use nom::sequence::tuple;
 | 
			
		||||
 | 
			
		||||
use super::parser_with_context::parser_with_context;
 | 
			
		||||
use super::util::get_consumed;
 | 
			
		||||
@ -54,9 +61,15 @@ pub fn regular_link_with_description<'r, 's>(
 | 
			
		||||
 | 
			
		||||
#[tracing::instrument(ret, level = "debug")]
 | 
			
		||||
pub fn pathreg<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<&'s str, &'s str> {
 | 
			
		||||
    let (remaining, _opening_bracket) = tag("[[")(input)?;
 | 
			
		||||
    // pathreg
 | 
			
		||||
    todo!()
 | 
			
		||||
    let (remaining, path) = escaped(
 | 
			
		||||
        take_till1(|c| match c {
 | 
			
		||||
            '\\' | ']' => true,
 | 
			
		||||
            _ => false,
 | 
			
		||||
        }),
 | 
			
		||||
        '\\',
 | 
			
		||||
        one_of(r#"]"#),
 | 
			
		||||
    )(input)?;
 | 
			
		||||
    Ok((remaining, path))
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#[tracing::instrument(ret, level = "debug")]
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user