summaryrefslogtreecommitdiffstats
path: root/crates/driver/src/context.rs
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2024-04-02 22:41:05 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2024-04-03 22:31:14 +0200
commit42e667a5086fa4a6557ef7a64e40b833a93f3124 (patch)
tree1c6a1c3dc9063574e54e30bcb52e7e56aeb27591 /crates/driver/src/context.rs
parent89e193c1ab8184f74b2b40f3822e544d5e0d5163 (diff)
downloadrebel-42e667a5086fa4a6557ef7a64e40b833a93f3124.tar
rebel-42e667a5086fa4a6557ef7a64e40b833a93f3124.zip
driver: parse: introduce TaskID and TaskArgs struct
Make the parser code a bit clearer by not passing around tuples of strs.
Diffstat (limited to 'crates/driver/src/context.rs')
-rw-r--r--crates/driver/src/context.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/driver/src/context.rs b/crates/driver/src/context.rs
index 9674e5f..47259b3 100644
--- a/crates/driver/src/context.rs
+++ b/crates/driver/src/context.rs
@@ -357,8 +357,8 @@ impl Context {
pub fn parse(&self, s: &str) -> error::Result<(TaskRef, TaskFlags)> {
let (parsed, flags) = parse::parse_task_with_flags(s).context("Invalid task syntax")?;
- let recipe = parsed.recipe.to_string();
- let task = parsed.task.to_string();
+ let recipe = parsed.id.recipe.to_string();
+ let task = parsed.id.task.to_string();
let id = TaskID { recipe, task };
let (ctx_id, _) = self
@@ -368,7 +368,7 @@ impl Context {
let mut args = self.globals.clone();
- if let Some(host) = parsed.host {
+ if let Some(host) = parsed.args.host {
let plat = self
.platforms
.get(host)
@@ -376,7 +376,7 @@ impl Context {
args.set("host", Some(plat));
args.set("target", Some(plat));
}
- if let Some(target) = parsed.target {
+ if let Some(target) = parsed.args.target {
let plat = self
.platforms
.get(target)