From cbeeef486ea54ce9cdd529a43f43cc7a60e53e73 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Sun, 1 Feb 2009 22:27:43 +0000 Subject: [PATCH] Fixed the C backend putting too many braces in array literals, and removed some old comments --- backends/GenerateC.hs | 4 ++-- frontends/OccamPasses.hs | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/backends/GenerateC.hs b/backends/GenerateC.hs index aa50e48..125d421 100644 --- a/backends/GenerateC.hs +++ b/backends/GenerateC.hs @@ -591,7 +591,7 @@ cgenLiteralRepr (A.RecordLiteral _ es) _ seqComma $ map (call genUnfoldedExpression) es genRightB cgenLiteralRepr (A.ArrayListLiteral m aes) (A.Array {}) - = call genArrayLiteralElems aes + = genLeftB >> call genArrayLiteralElems aes >> genRightB cgenLiteralRepr (A.ArrayListLiteral _ es) t@(A.List {}) = call genListLiteral es t @@ -648,7 +648,7 @@ genDecimal s = tell [s] cgenArrayLiteralElems :: A.Structured A.Expression -> CGen () cgenArrayLiteralElems (A.Only _ e) = call genUnfoldedExpression e cgenArrayLiteralElems (A.Several _ aes) - = genLeftB >> (seqComma $ map cgenArrayLiteralElems aes) >> genRightB + = seqComma $ map cgenArrayLiteralElems aes genByteLiteral :: Meta -> String -> CGen () genByteLiteral m s diff --git a/frontends/OccamPasses.hs b/frontends/OccamPasses.hs index 1497894..6146fd5 100644 --- a/frontends/OccamPasses.hs +++ b/frontends/OccamPasses.hs @@ -41,16 +41,12 @@ occamPasses = [ occamOnlyPass "Dummy occam pass" [] (Prop.agg_namesDone ++ [Prop.mainTagged]) return , inferTypes , foldConstants --- , fixNestedArrayLiterals , fixConstructorTypes , checkConstants , resolveAmbiguities , checkTypes ] ---fixNestedArrayLiterals :: Pass ---fixNestedArrayLiterals = occamOnlyPass "Collapse nested array literals" - -- | Fixed the types of array constructors according to the replicator count fixConstructorTypes :: Pass fixConstructorTypes = occamOnlyPass "Fix the types of array constructors"