From 803a7f027541067b6ee30a805114a88b934a33aa Mon Sep 17 00:00:00 2001 From: Francis Russell Date: Wed, 19 Sep 2012 16:32:18 +0100 Subject: [PATCH] Validate degree of spatial derivatives. --- src/TopLevel.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/TopLevel.hs b/src/TopLevel.hs index 8cd8ea2..9d1e0f5 100644 --- a/src/TopLevel.hs +++ b/src/TopLevel.hs @@ -275,7 +275,11 @@ validateExpression ofl (PositionComponent i) = do indexExists ofl i indexIsType ofl i SpatialIndex -validateExpression ofl (SpatialDerivative e d _) = do +validateExpression ofl (SpatialDerivative e d n) = do validateExpression ofl e + isFunction ofl e indexExists ofl d + if n > 0 + then validationSuccess + else validationFailure $ "Degree of derivative of " ++ show e ++ " must be greater than 0." indexIsType ofl d SpatialIndex -- 2.47.3