summaryrefslogtreecommitdiffstats
path: root/crates/rebel-parse/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/rebel-parse/src/lib.rs')
-rw-r--r--crates/rebel-parse/src/lib.rs18
1 files changed, 7 insertions, 11 deletions
diff --git a/crates/rebel-parse/src/lib.rs b/crates/rebel-parse/src/lib.rs
index fa72b42..d9a59cf 100644
--- a/crates/rebel-parse/src/lib.rs
+++ b/crates/rebel-parse/src/lib.rs
@@ -1,15 +1,13 @@
+use rebel_common::types::TaskIDRef;
+
+pub use rules::*;
+
#[derive(Debug, Clone, Copy)]
pub struct TaskRef<'a> {
- pub id: TaskID<'a>,
+ pub id: TaskIDRef<'a>,
pub args: TaskArgs<'a>,
}
-#[derive(Debug, Clone, Copy)]
-pub struct TaskID<'a> {
- pub recipe: &'a str,
- pub task: &'a str,
-}
-
#[derive(Debug, Clone, Copy, Default)]
pub struct TaskArgs<'a> {
pub host: Option<&'a str>,
@@ -37,9 +35,9 @@ peg::parser! {
rule recipe_id() -> &'input str
= $(name() ("/" name())?)
- rule task_id() -> TaskID<'input>
+ rule task_id() -> TaskIDRef<'input>
= recipe:recipe_id() "::" task:name() {
- TaskID { recipe, task }
+ TaskIDRef { recipe, task }
}
rule task_args() -> TaskArgs<'input>
@@ -65,5 +63,3 @@ peg::parser! {
= tag() v:value() { v }
}
}
-
-pub use rules::*;