Skip to content
Draft
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 77 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,9 @@ features = ["derive"]
version = "1.3.1"
default-features = false

[dev-dependencies]
pretty_assertions = "1.2"
factori = "1.1.0"

[profile.release]
debug = 2
5 changes: 5 additions & 0 deletions parser/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@ edition = "2021"
pulldown-cmark = "0.7.0"
log = "0.4"
regex = "1.6.0"
postgres-types = { version = "0.2.4", features = ["derive"] }

[dependencies.serde]
version = "1"
features = ["derive"]
8 changes: 8 additions & 0 deletions parser/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use regex::Regex;

pub mod assign;
pub mod close;
pub mod decision;
pub mod glacier;
pub mod nominate;
pub mod note;
Expand All @@ -26,6 +27,7 @@ pub enum Command<'a> {
Shortcut(Result<shortcut::ShortcutCommand, Error<'a>>),
Close(Result<close::CloseCommand, Error<'a>>),
Note(Result<note::NoteCommand, Error<'a>>),
Decision(Result<decision::DecisionCommand, Error<'a>>),
}

#[derive(Debug)]
Expand Down Expand Up @@ -132,6 +134,11 @@ impl<'a> Input<'a> {
Command::Close,
&original_tokenizer,
));
success.extend(parse_single_command(
decision::DecisionCommand::parse,
Command::Decision,
&original_tokenizer,
));

if success.len() > 1 {
panic!(
Expand Down Expand Up @@ -207,6 +214,7 @@ impl<'a> Command<'a> {
Command::Shortcut(r) => r.is_ok(),
Command::Close(r) => r.is_ok(),
Command::Note(r) => r.is_ok(),
Command::Decision(r) => r.is_ok(),
}
}

Expand Down
Loading