From 287fb8b922fadec20c595cf919afe2c713c37cef Mon Sep 17 00:00:00 2001 From: Adam Sampson Date: Tue, 1 May 2007 14:31:36 +0000 Subject: [PATCH] Ignore ROUND/TRUNC when used on a precise conversion (e.g. REAL64 ROUND real64) --- fco2/Parse.hs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/fco2/Parse.hs b/fco2/Parse.hs index 2191a61..ddeb1e4 100644 --- a/fco2/Parse.hs +++ b/fco2/Parse.hs @@ -987,13 +987,14 @@ conversion t <- dataType (c, o) <- conversionMode ot <- typeOfExpression o - case (isPreciseConversion ot t, c) of - (False, A.DefaultConversion) -> - fail "imprecise conversion must specify ROUND or TRUNC" - (False, _) -> return () - (True, A.DefaultConversion) -> return () - (True, _) -> - fail "precise conversion cannot specify ROUND or TRUNC" + c <- case (isPreciseConversion ot t, c) of + (False, A.DefaultConversion) -> + fail "imprecise conversion must specify ROUND or TRUNC" + (False, _) -> return c + (True, A.DefaultConversion) -> return c + (True, _) -> + do addWarning m "precise conversion specifies ROUND or TRUNC; ignored" + return A.DefaultConversion return $ A.Conversion m c t o "conversion"