From d8b8c223f05ebb67d5b93382891413102f04f718 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Sat, 13 Jun 2020 22:12:00 -0400 Subject: [PATCH] Add stubs for the math functions. --- src/bin.rs | 28 ++++++++++++++++++++++++++++ src/renderer/context_element.rs | 7 +++++++ src/renderer/parameters_context.rs | 28 ++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+) diff --git a/src/bin.rs b/src/bin.rs index 9669d2e..f611a97 100644 --- a/src/bin.rs +++ b/src/bin.rs @@ -439,6 +439,34 @@ impl CompareContextElement for serde_json::Value { .map(IceResult::from_owned), } } + + fn math_subtract<'a>(&self, other: &dyn ContextElement) -> Option> { + todo!() + } + + fn math_multiply<'a>(&self, other: &dyn ContextElement) -> Option> { + todo!() + } + + fn math_divide<'a>(&self, other: &dyn ContextElement) -> Option> { + todo!() + } + + fn math_modulus<'a>(&self, other: &dyn ContextElement) -> Option> { + todo!() + } + + fn math_abs<'a>(&self) -> Option> { + todo!() + } + + fn math_floor<'a>(&self) -> Option> { + todo!() + } + + fn math_ceil<'a>(&self) -> Option> { + todo!() + } } #[derive(Debug)] diff --git a/src/renderer/context_element.rs b/src/renderer/context_element.rs index 7edd71d..fe78473 100644 --- a/src/renderer/context_element.rs +++ b/src/renderer/context_element.rs @@ -69,6 +69,13 @@ pub trait CompareContextElement: CastToAny { fn partial_compare(&self, other: &dyn ContextElement) -> Option; fn math_add<'a>(&self, other: &dyn ContextElement) -> Option>; + fn math_subtract<'a>(&self, other: &dyn ContextElement) -> Option>; + fn math_multiply<'a>(&self, other: &dyn ContextElement) -> Option>; + fn math_divide<'a>(&self, other: &dyn ContextElement) -> Option>; + fn math_modulus<'a>(&self, other: &dyn ContextElement) -> Option>; + fn math_abs<'a>(&self) -> Option>; + fn math_floor<'a>(&self) -> Option>; + fn math_ceil<'a>(&self) -> Option>; } impl CastToAny for C { diff --git a/src/renderer/parameters_context.rs b/src/renderer/parameters_context.rs index 25695e0..fa747f9 100644 --- a/src/renderer/parameters_context.rs +++ b/src/renderer/parameters_context.rs @@ -373,4 +373,32 @@ impl CompareContextElement for OwnedLiteral { }, } } + + fn math_subtract<'a>(&self, other: &dyn ContextElement) -> Option> { + todo!() + } + + fn math_multiply<'a>(&self, other: &dyn ContextElement) -> Option> { + todo!() + } + + fn math_divide<'a>(&self, other: &dyn ContextElement) -> Option> { + todo!() + } + + fn math_modulus<'a>(&self, other: &dyn ContextElement) -> Option> { + todo!() + } + + fn math_abs<'a>(&self) -> Option> { + todo!() + } + + fn math_floor<'a>(&self) -> Option> { + todo!() + } + + fn math_ceil<'a>(&self) -> Option> { + todo!() + } }