diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2024-04-03 21:43:46 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2024-04-03 22:31:14 +0200 |
commit | 142ab0db2902a42b1c11f9682d366a5c7750c649 (patch) | |
tree | f090807ba019a31ad963246159c3cd1b8cc842d1 /crates/driver/src/context.rs | |
parent | 42e667a5086fa4a6557ef7a64e40b833a93f3124 (diff) | |
download | rebel-142ab0db2902a42b1c11f9682d366a5c7750c649.tar rebel-142ab0db2902a42b1c11f9682d366a5c7750c649.zip |
driver: parse: replace nom with peg
The PEG-based parser is much more concise and easier to understand than
the old combinator solution.
Diffstat (limited to 'crates/driver/src/context.rs')
-rw-r--r-- | crates/driver/src/context.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/driver/src/context.rs b/crates/driver/src/context.rs index 47259b3..4698171 100644 --- a/crates/driver/src/context.rs +++ b/crates/driver/src/context.rs @@ -355,7 +355,9 @@ 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 (parsed, flags) = parse::task_with_flags(s) + .ok() + .context("Invalid task syntax")?; let recipe = parsed.id.recipe.to_string(); let task = parsed.id.task.to_string(); |