Evaluate some simple statements
This commit is contained in:
parent
778576a63c
commit
3a219ecac2
6 changed files with 184 additions and 12 deletions
|
|
@ -355,7 +355,11 @@ pub enum Statement {
|
|||
From(Option<NaiveDate>),
|
||||
Until(Option<NaiveDate>),
|
||||
Except(NaiveDate), // TODO Allow excluding ranges
|
||||
Move(NaiveDate, NaiveDate),
|
||||
Move {
|
||||
span: Span,
|
||||
from: NaiveDate,
|
||||
to: NaiveDate,
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
|
|
@ -440,6 +444,22 @@ pub enum Command {
|
|||
Note(Note),
|
||||
}
|
||||
|
||||
impl Command {
|
||||
pub fn title(&self) -> &str {
|
||||
match self {
|
||||
Command::Task(task) => &task.title,
|
||||
Command::Note(note) => ¬e.title,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn desc(&self) -> &[String] {
|
||||
match self {
|
||||
Command::Task(task) => &task.desc,
|
||||
Command::Note(note) => ¬e.desc,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct File {
|
||||
pub contents: String,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue