Skip to content

Commit

Permalink
Adding new file for parsing code
Browse files Browse the repository at this point in the history
  • Loading branch information
WGUNDERWOOD committed May 3, 2024
1 parent 70a1a51 commit 615946c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 18 deletions.
5 changes: 1 addition & 4 deletions notes.org
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,11 @@
** Ignore source lines
*** Line-by-line ignore
*** Block ignore
** Tests should compile to same pdf
** Documentation
** Tidy up code
** Find todos
** Clippy
** New source files: write.rs, parse.rs, print.rs
** New source files: write.rs, print.rs
** Tests better output
* Bugs
** Better errors including line numbers in source file
** Handle list items properly
* Structure
16 changes: 2 additions & 14 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,15 @@ const YELLOW: &str = "\x1b[33m\x1b[1m";
const PINK: &str = "\x1b[35m\x1b[1m";
const RESET: &str = "\x1b[00m\x1b[0m";

#[derive(Parser)]
struct Cli {
#[arg(long, short, help = "Print to stdout, do not modify files")]
print: bool,
#[arg(
long,
short,
help = "Debug mode, disable checks and do not modify files"
)]
debug: bool,
#[arg(required = true)]
filenames: Vec<String>,
}

mod comments;
mod format;
mod indent;
mod parse;
mod regexes;
mod subs;
mod wrap;
use crate::format::*;
use crate::parse::Cli;

#[cfg(test)]
mod tests;
Expand Down
16 changes: 16 additions & 0 deletions src/parse.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
use crate::Parser;

#[derive(Parser)]
pub struct Cli {
#[arg(long, short, help = "Print to stdout, do not modify files")]
pub print: bool,
#[arg(
long,
short,
help = "Debug mode, disable checks and do not modify files"
)]
pub debug: bool,
#[arg(required = true)]
pub filenames: Vec<String>,
}

0 comments on commit 615946c

Please sign in to comment.