Fixed the C backend putting too many braces in array literals, and removed some old comments
This commit is contained in:
parent
80a3eba49a
commit
cbeeef486e
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue
Block a user