From: Francis Russell Date: Wed, 19 Sep 2012 15:32:18 +0000 (+0100) Subject: Validate degree of spatial derivatives. X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=803a7f027541067b6ee30a805114a88b934a33aa;p=francis%2Fofc.git Validate degree of spatial derivatives. --- 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