From ae049da654271d3b7f679edd60c4c8eb43351c28 Mon Sep 17 00:00:00 2001 From: Thomas Knudsen Date: Tue, 1 Aug 2023 22:24:24 +0200 Subject: [PATCH] Linguistics --- src/bin/kp.rs | 2 +- src/inner_op/pipeline.rs | 2 +- src/op/mod.rs | 2 +- src/op/raw_parameters.rs | 7 ++++--- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/bin/kp.rs b/src/bin/kp.rs index f517ba4..ca8aa51 100644 --- a/src/bin/kp.rs +++ b/src/bin/kp.rs @@ -134,7 +134,7 @@ fn main() -> Result<(), anyhow::Error> { // To avoid unlimited buffer growth, we send material // on to the transformation factory every time, we have - // 25000 operans to operate on + // 25000 operands to operate on if operands.len() == 25000 { number_of_operands_succesfully_transformed += transform(&options, op, &mut operands, &ctx)?; diff --git a/src/inner_op/pipeline.rs b/src/inner_op/pipeline.rs index f9da3b0..438c883 100644 --- a/src/inner_op/pipeline.rs +++ b/src/inner_op/pipeline.rs @@ -240,7 +240,7 @@ mod tests { // 1234-order, while pop happens in 4321-order, so a // "push all, pop all" pair is a noop: The order of operator // options is insignificant, so the 1234/4321 order is, in principle - // arbitrary, but seleted with the noop-characteristicum in mind. + // arbitrary, but selected with the noop-characteristics in mind. let op = ctx.op("push v_1 v_2|pop v_1 v_2")?; ctx.apply(op, Fwd, &mut data)?; assert_eq!(data[0][0], 12.); diff --git a/src/op/mod.rs b/src/op/mod.rs index 9bc6a77..19bb435 100644 --- a/src/op/mod.rs +++ b/src/op/mod.rs @@ -11,6 +11,7 @@ pub use parameter::OpParameter; pub use parsed_parameters::ParsedParameters; pub use raw_parameters::RawParameters; +/// The key, returned to the user, representing the actual operation handled by the `Context` #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Copy, Clone)] pub struct OpHandle(uuid::Uuid); impl OpHandle { @@ -213,7 +214,6 @@ pub fn split_into_steps(definition: &str) -> (Vec, String) { .to_string(); // Collect docstrings and remove plain comments - //let mut trimmed = Vec::::new(); let mut trimmed = String::new(); let mut docstring = Vec::::new(); for line in all.lines() { diff --git a/src/op/raw_parameters.rs b/src/op/raw_parameters.rs index f00a324..02811f2 100644 --- a/src/op/raw_parameters.rs +++ b/src/op/raw_parameters.rs @@ -1,6 +1,6 @@ // `RawParameters` is the vehicle used by the `Op`erator factory in `Op::op(...)`, // to ferry args around from the invocator into the constructor of the individual -// `InnerOp`s. The `InnrOp`constructor typically interprets the contents of +// `InnerOp`s. The `InnerOp`constructor typically interprets the contents of // `RawParameters`, and converts it into a more runtime friendly instance of // `ParsedParameters`. @@ -44,8 +44,9 @@ impl RawParameters { } } - // If the next step is a macro (i.e. potentially an embedded pipeline), we - // get the arguments from the invocation and bring them into the globals. + // If the next step is a macro (i.e. potentially an embedded pipeline), + // we take a copy of the arguments from the macro invocation and enter + // them into the globals. // Otherwise, we just copy the globals from the previous step, and // update the recursion counter. pub fn next(&self, definition: &str) -> RawParameters {