misc: remove unused import and format code.

This commit is contained in:
jackfiled 2024-12-01 22:01:36 +08:00
parent dbc56a477b
commit 307af5679b
3 changed files with 3 additions and 7 deletions

View File

@ -58,7 +58,7 @@ where
#[cfg(test)] #[cfg(test)]
mod test { mod test {
use crate::combinators::ParserExt; use crate::combinators::ParserExt;
use crate::parser::{parser_test_helper, Parser, ParserContext}; use crate::parser::{parser_test_helper, Parser};
use crate::text::char_parser; use crate::text::char_parser;
#[test] #[test]

View File

@ -8,8 +8,7 @@ fn validate_tokens(input: &'static str, tokens: Vec<LexicalTokenType>) {
let context = ParserContext::new(()); let context = ParserContext::new(());
let word: Vec<char> = input.chars().collect(); let word: Vec<char> = input.chars().collect();
let (_, actual_tokens) = let (_, actual_tokens) = zero_lexical_parser(context.clone(), word.as_slice()).unwrap();
zero_lexical_parser(context.clone(),word.as_slice()).unwrap();
dbg!(&tokens, &actual_tokens); dbg!(&tokens, &actual_tokens);
assert_eq!(tokens.len(), actual_tokens.len()); assert_eq!(tokens.len(), actual_tokens.len());

View File

@ -15,10 +15,7 @@ mod tokenizer;
fn assert_lexical_parser( fn assert_lexical_parser(
except: LexicalToken, except: LexicalToken,
parser: fn( parser: fn(Rc<RefCell<ParserContext<()>>>, &[char]) -> ParserResult<char, NewLexicalToken>,
Rc<RefCell<ParserContext<()>>>,
&[char],
) -> ParserResult<char, NewLexicalToken>,
input: &str, input: &str,
) { ) {
let context = ParserContext::new(()); let context = ParserContext::new(());