Skip to content

Commit

Permalink
cant' link the test now
Browse files Browse the repository at this point in the history
  • Loading branch information
alensiljak committed Oct 16, 2023
1 parent 6f3356f commit 21941e9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
12 changes: 5 additions & 7 deletions src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,14 @@ impl<'j, T: Read> Parser<'j, T> {
}

// The rest
c => {
_ => {
// 4.7.2 command directives

if self.general_directive() {
return Ok(());
}

let c = 'P';
match c {
// ACDNPY
'P' => {
Expand Down Expand Up @@ -226,7 +227,8 @@ impl<'j, T: Read> Parser<'j, T> {
// bcde
'i' => match directive {
"include" => {
self.include_directive(argument.unwrap());
let own_argument = argument.unwrap().to_owned();
self.include_directive(&own_argument);
return true;
}
"import" => {
Expand Down Expand Up @@ -365,11 +367,7 @@ impl<'j, T: Read> Parser<'j, T> {
// let base = filename.file_name();

// read file.
//read_into_journal(source, journal);
// parse_file(filename.to_str().unwrap(), self.journal);
todo!("read file");
// The problem is again having a mutable reference and immutable ones.
// Try using Nom for parsing instead.
parse_file(filename.to_str().unwrap(), self.journal);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ impl<T: Read> Iterator for DirectiveIter<T> {
mod tests {
use std::io::Cursor;

use crate::{reader::create_str_reader, directives::DirectiveType};
use crate::reader::create_str_reader;

#[test]
fn basic_test() {
Expand Down

0 comments on commit 21941e9

Please sign in to comment.