Skip to content

Commit 5c926b8

Browse files
committed
Make mkList take a Position argument
1 parent 62e2902 commit 5c926b8

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/comp/CSyntaxUtil.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ mkMaybe :: (Maybe CExpr) -> CExpr
6363
mkMaybe Nothing = CCon idInvalid []
6464
mkMaybe (Just e) = CCon idValid [e]
6565

66-
mkList :: [CExpr] -> CExpr
67-
mkList [] = CCon (idNil noPosition) []
68-
mkList (e:es) = CCon (idCons $ getPosition e) [e, mkList es]
66+
mkList :: Position -> [CExpr] -> CExpr
67+
mkList pos [] = CCon (idNil pos) []
68+
mkList pos (e:es) = CCon (idCons pos) [e, mkList pos es]
6969

7070
num_to_cliteral_at :: Integral n => Position -> n -> CLiteral
7171
num_to_cliteral_at pos num = CLiteral pos $ LInt $ ilDec (toInteger num)

src/comp/GenWrap.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,7 @@ genTo pps ty mk =
11071107
localPrefix1 = fromMaybe (getIdBaseString f) (lookupPrefixIfcPragma ciPrags)
11081108
localPrefix = joinStrings_ currentPre localPrefix1
11091109
prefix = stringLiteralAt noPosition localPrefix
1110-
arg_names = mkList [stringLiteralAt (getPosition i) (getIdString i) | i <- aIds]
1110+
arg_names = mkList (getPosition f) [stringLiteralAt (getPosition i) (getIdString i) | i <- aIds]
11111111
fnp = mkProxy $ TAp (cTCon idStrArg) $ cTStr (fieldPathName prefixes f)(getIdPosition f)
11121112
-- XXX idEmpty is a horrible way to know no more selection is required
11131113
let ec = if f == idEmpty then sel else CSelect sel (setInternal f)
@@ -2204,7 +2204,7 @@ mkFieldSavePortTypeStmts v ifcId = concatMapM $ meth noPrefixes ifcId
22042204
let fproxy = mkProxy $ TAp (cTCon idStrArg) $ cTStr (fieldPathName prefixes f) (getIdPosition f)
22052205
proxy = mkProxy $ foldr arrow r as
22062206
prefix = stringLiteralAt noPosition localPrefix
2207-
arg_names = mkList [stringLiteralAt (getPosition i) (getIdString i) | i <- aIds]
2207+
arg_names = mkList (getPosition f) [stringLiteralAt (getPosition i) (getIdString i) | i <- aIds]
22082208
result = stringLiteralAt noPosition resultName
22092209
return [
22102210
CSExpr Nothing $

0 commit comments

Comments
 (0)