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
|
seqComma $ map (call genUnfoldedExpression) es
|
||||||
genRightB
|
genRightB
|
||||||
cgenLiteralRepr (A.ArrayListLiteral m aes) (A.Array {})
|
cgenLiteralRepr (A.ArrayListLiteral m aes) (A.Array {})
|
||||||
= call genArrayLiteralElems aes
|
= genLeftB >> call genArrayLiteralElems aes >> genRightB
|
||||||
cgenLiteralRepr (A.ArrayListLiteral _ es) t@(A.List {})
|
cgenLiteralRepr (A.ArrayListLiteral _ es) t@(A.List {})
|
||||||
= call genListLiteral es t
|
= call genListLiteral es t
|
||||||
|
|
||||||
|
@ -648,7 +648,7 @@ genDecimal s = tell [s]
|
||||||
cgenArrayLiteralElems :: A.Structured A.Expression -> CGen ()
|
cgenArrayLiteralElems :: A.Structured A.Expression -> CGen ()
|
||||||
cgenArrayLiteralElems (A.Only _ e) = call genUnfoldedExpression e
|
cgenArrayLiteralElems (A.Only _ e) = call genUnfoldedExpression e
|
||||||
cgenArrayLiteralElems (A.Several _ aes)
|
cgenArrayLiteralElems (A.Several _ aes)
|
||||||
= genLeftB >> (seqComma $ map cgenArrayLiteralElems aes) >> genRightB
|
= seqComma $ map cgenArrayLiteralElems aes
|
||||||
|
|
||||||
genByteLiteral :: Meta -> String -> CGen ()
|
genByteLiteral :: Meta -> String -> CGen ()
|
||||||
genByteLiteral m s
|
genByteLiteral m s
|
||||||
|
|
|
@ -41,16 +41,12 @@ occamPasses =
|
||||||
[ occamOnlyPass "Dummy occam pass" [] (Prop.agg_namesDone ++ [Prop.mainTagged]) return
|
[ occamOnlyPass "Dummy occam pass" [] (Prop.agg_namesDone ++ [Prop.mainTagged]) return
|
||||||
, inferTypes
|
, inferTypes
|
||||||
, foldConstants
|
, foldConstants
|
||||||
-- , fixNestedArrayLiterals
|
|
||||||
, fixConstructorTypes
|
, fixConstructorTypes
|
||||||
, checkConstants
|
, checkConstants
|
||||||
, resolveAmbiguities
|
, resolveAmbiguities
|
||||||
, checkTypes
|
, checkTypes
|
||||||
]
|
]
|
||||||
|
|
||||||
--fixNestedArrayLiterals :: Pass
|
|
||||||
--fixNestedArrayLiterals = occamOnlyPass "Collapse nested array literals"
|
|
||||||
|
|
||||||
-- | Fixed the types of array constructors according to the replicator count
|
-- | Fixed the types of array constructors according to the replicator count
|
||||||
fixConstructorTypes :: Pass
|
fixConstructorTypes :: Pass
|
||||||
fixConstructorTypes = occamOnlyPass "Fix the types of array constructors"
|
fixConstructorTypes = occamOnlyPass "Fix the types of array constructors"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user