~ioiojo/kiwi

8d7649ad4edb9462d3be1f14b92003ced6002ae0 — Andy Weidenbaum 2 years ago 1d15a5e
s/‘|’/' s/“|”/"
M kiwi/macros.fnl => kiwi/macros.fnl +2 -2
@@ 15,8 15,8 @@
      (f k v))))

;; setup imports (possibly fallibly) via assigning the (multival)
;; result of applying each local function table keypair key (an “action
;; function”, e.g. `require`) to each keypair value (a string,
;; result of applying each local function table keypair key (an "action
;; function", e.g. `require`) to each keypair value (a string,
;; e.g. `:module/name`) in its associated bind table
(fn init-locals [new-local-fns]
  `,(let [aliases []

M src/dir.rs => src/dir.rs +2 -2
@@ 174,8 174,8 @@ fn process_dates(
    dates: Option<Vec<(usize, InputDateStringResult<NaiveDateTime>)>>,
    errors: &mut Option<Vec<DirErrorKind>>,
) -> Option<(usize, NaiveDateTime)> {
    // Categorize `NaiveDateTime` in `DATESTRING_POSITION` (0) as “in position” (ip);
    // mark all others as “out of position” (oop).
    // Categorize `NaiveDateTime` in `DATESTRING_POSITION` (0) as "in position" (ip);
    // mark all others as "out of position" (oop).
    let (ip_date, mut oop_dates): (
        Option<(usize, InputDateStringResult<NaiveDateTime>)>,
        Option<Vec<(usize, InputDateStringResult<NaiveDateTime>)>>,

M src/dir_arg.rs => src/dir_arg.rs +2 -2
@@ 15,9 15,9 @@ use crate::utils;
/// Format string for use with `chrono::NaiveDateTime::parse_from_str()`.
const DATE_FMT: &str = "%Y-%m-%dT%H:%M:%S";

/// A collection of `Result`-wrapped arguments paired with a numeric “count”.
/// A collection of `Result`-wrapped arguments paired with a numeric "count".
///
/// “Count” is the `usize` order in which the argument appeared within the
/// "Count" is the `usize` order in which the argument appeared within the
/// `rlua::MultiValue` from which it was instantiated.
pub struct DirArgs(pub Vec<(usize, DirArg)>);


M src/dir_error.rs => src/dir_error.rs +1 -1
@@ 70,7 70,7 @@ impl DirError {
                .collect(),
        };

        // Anticipate rlua's automatic insertion of “runtime error:”.
        // Anticipate rlua's automatic insertion of "runtime error:".
        errors.insert(0, "Dine could not be instantiated".to_string());

        let errors = errors.join("\n\n");

M src/fir.rs => src/fir.rs +2 -2
@@ 205,8 205,8 @@ fn process_strings(
    strings: Option<Vec<(usize, InputStringResult<String>)>>,
    errors: &mut Option<Vec<FirErrorKind>>,
) -> Option<(usize, String)> {
    // Categorize string in `DOCSTRING_POSITION` (0) as “in position” (ip); mark all
    // other strings as “out of position” (oop).
    // Categorize string in `DOCSTRING_POSITION` (0) as "in position" (ip); mark all
    // other strings as "out of position" (oop).
    let (ip_docstring, mut oop_strings): (
        Option<(usize, InputStringResult<String>)>,
        Option<Vec<(usize, InputStringResult<String>)>>,

M src/fir_arg.rs => src/fir_arg.rs +6 -6
@@ 53,9 53,9 @@ const TABLE_GET_2_EXPECT: &str = "`rlua::Table::get(2)` unexpectedly failed";
/// where we don't expect the conversion to fail.
const TRY_INTO_RATIO_EXPECT: &str = "Ratio-checked value unexpectedly failed to convert into ratio";

/// A collection of `Result`-wrapped arguments paired with a numeric “count”.
/// A collection of `Result`-wrapped arguments paired with a numeric "count".
///
/// “Count” is the `usize` order in which the argument appeared within the
/// "Count" is the `usize` order in which the argument appeared within the
/// `rlua::MultiValue` from which it was instantiated.
pub struct FirArgs(pub Vec<(usize, FirArg)>);



@@ 694,7 694,7 @@ where
    I: Iterator<Item = Value<'a>>,
{
    // Avoids calling `iter.next()` unless the next item is a ratio. Theoretically
    // improves error reporting, by allowing to “skip over” what should've been a
    // improves error reporting, by allowing to "skip over" what should've been a
    // `Quantity` paired with a `Food`, and proceed onto the next `Food`-`Quantity` pair.
    match iter.peek() {
        Some(value) if value.is_ratio() => {


@@ 924,7 924,7 @@ impl TryFrom<Value<'_>> for Aka {
                    InputStringError::MalformedString { content } => {
                        Err(DictAkaError::MalformedString { aka: content })
                    }
                    // “`StringOrList`” due to fallthrough.
                    // "`StringOrList`" due to fallthrough.
                    InputStringError::MissingString { got } => {
                        Err(DictAkaError::MissingStringOrList { got })
                    }


@@ 2157,7 2157,7 @@ impl TryFrom<Value<'_>> for Fiber {
                        Err(DictFiberError::MalformedSansTotalInteger { integer })
                    }
                    InputNumberGteZeroError::MissingNumberGteZero { got } => {
                        // “`NumberOrList`” due to fallthrough.
                        // "`NumberOrList`" due to fallthrough.
                        Err(DictFiberError::MissingNumberOrList { got })
                    }
                },


@@ 2500,7 2500,7 @@ impl TryFrom<Value<'_>> for Quantity {
                        Err(InputQuantityError::MalformedInteger { integer })
                    }
                    InputNumberGteZeroError::MissingNumberGteZero { got } => {
                        // “`NumberOrList`” due to fallthrough.
                        // "`NumberOrList`" due to fallthrough.
                        Err(InputQuantityError::MissingNumberOrList { got })
                    }
                },

M src/fir_error.rs => src/fir_error.rs +1 -1
@@ 85,7 85,7 @@ impl FirError {
            }
        };

        // Anticipate rlua's automatic insertion of “runtime error:”.
        // Anticipate rlua's automatic insertion of "runtime error:".
        errors.insert(0, "Food could not be instantiated".to_string());

        let errors = errors.join("\n\n");

M src/food_env.rs => src/food_env.rs +2 -2
@@ 5,9 5,9 @@ use crate::food_amino_acids::AminoAcids;
use crate::food_fiber::Fiber;
use crate::food_measure::ServingSizeish;

/// The `Simple` food “environment”. Encapsulates values which vary upon food math, e.g.
/// The `Simple` food "environment". Encapsulates values which vary upon food math, e.g.
/// the `protein` value reported (see: `kiwi::Value`) increases if the user multiplies
/// the food - and its “food environment” - by a number greater than 1.
/// the food - and its "food environment" - by a number greater than 1.
#[derive(Clone, Debug)]
pub struct SimpleEnv {
    /// The serving size applicable to the other `Env` fields.

M src/food_expr.rs => src/food_expr.rs +4 -4
@@ 31,7 31,7 @@ impl PartialEq for Expr {
impl Eq for Expr {}

/// When the `Expr` (`self`) to be added to by the other `Expr` (`other`) is an
/// `Operation::Addition`, it gets “combined” with `other`, e.g.
/// `Operation::Addition`, it gets "combined" with `other`, e.g.
///
/// ```fennel,ignore
/// (add '(add 1 2) expr) ; -> '(add 1 2 expr)


@@ 70,7 70,7 @@ impl Add for Expr {
}

/// When the `Expr` being added to by the `Quantity` is an `Operation::Addition`, it gets
/// “combined” with the `Quantity`, e.g.
/// "combined" with the `Quantity`, e.g.
///
/// ```fennel,ignore
/// (add '(add 1 2) quantity) ; -> '(add 1 2 quantity)


@@ 108,7 108,7 @@ impl Add<Quantity> for Expr {
}

/// When the `Expr` being divided by the `Quantity` is an `Operation::Division`, it gets
/// “combined” with the `Quantity`, e.g.
/// "combined" with the `Quantity`, e.g.
///
/// ```fennel,ignore
/// (div '(div 1 2) quantity) ; -> '(div 1 2 quantity)


@@ 146,7 146,7 @@ impl Div<Quantity> for Expr {
}

/// When the `Expr` being multiplied by the `Quantity` is an `Operation::Multiply`, it
/// gets “combined” with the `Quantity`, e.g.
/// gets "combined" with the `Quantity`, e.g.
///
/// ```fennel,ignore
/// (mul '(mul 1 2) quantity) ; -> '(mul 1 2 quantity)

M src/tir_arg.rs => src/tir_arg.rs +2 -2
@@ 6,9 6,9 @@ use crate::tir_error::InputDineError;
use crate::tir_types::InputDineResult;
use crate::utils;

/// A collection of `Result`-wrapped arguments paired with a numeric “count”.
/// A collection of `Result`-wrapped arguments paired with a numeric "count".
///
/// “Count” is the `usize` order in which the argument appeared within the
/// "Count" is the `usize` order in which the argument appeared within the
/// `rlua::MultiValue` from which it was instantiated.
pub struct TirArgs(pub Vec<(usize, TirArg)>);


M src/tir_error.rs => src/tir_error.rs +1 -1
@@ 48,7 48,7 @@ impl TirError {
                .collect(),
        };

        // Anticipate rlua's automatic insertion of “runtime error:”.
        // Anticipate rlua's automatic insertion of "runtime error:".
        errors.insert(0, "Diet could not be instantiated".to_string());

        let errors = errors.join("\n\n");