git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
C++: 0.10.2 merge fixes
9355f2fAndy Arvanitis
pcc/Main.hs+4−3
@@ -29,6 +29,7 @@ import Data.Bool (bool)
29import qualified Data.ByteString.Lazy as B
29import qualified Data.ByteString.Lazy as B
30import qualified Data.ByteString.UTF8 as BU8
30import qualified Data.ByteString.UTF8 as BU8
31import qualified Data.Map as M
31import qualified Data.Map as M
32+import Data.Text (Text)
32import Data.Version (showVersion)
33import Data.Version (showVersion)
33
34
34import qualified Language.PureScript as P
35import qualified Language.PureScript as P
@@ -42,7 +43,7 @@ import qualified System.Console.ANSI as ANSI
42import System.Exit (exitSuccess, exitFailure)
43import System.Exit (exitSuccess, exitFailure)
43import System.FilePath.Glob (glob)
44import System.FilePath.Glob (glob)
44import System.IO (hSetEncoding, hPutStrLn, stdout, stderr, utf8)
45import System.IO (hSetEncoding, hPutStrLn, stdout, stderr, utf8)
45−import System.IO.UTF8
46+import System.IO.UTF8 (readUTF8FileT)
46
47
47import Make
48import Make
48import Makefile
49import Makefile
@@ -100,8 +101,8 @@ globWarningOnMisses warn = concatMapM globWithWarning
100 return paths
101 return paths
101 concatMapM f = liftM concat . mapM f
102 concatMapM f = liftM concat . mapM f
102
103
103−readInput :: [FilePath] -> IO [(FilePath, String)]
104+readInput :: [FilePath] -> IO [(FilePath, Text)]
104−readInput inputFiles = forM inputFiles $ \inFile -> (inFile, ) <$> readUTF8File inFile
105+readInput inputFiles = forM inputFiles $ \inFile -> (inFile, ) <$> readUTF8FileT inFile
105
106
106inputFile :: Parser FilePath
107inputFile :: Parser FilePath
107inputFile = strArgument $
108inputFile = strArgument $
pcc/TestMain.hs+12−8
@@ -98,14 +98,18 @@ repo = "git://github.com/pure11/"
98packages :: [(String, String)]
98packages :: [(String, String)]
99-------------------------------------------------------------------------------
99-------------------------------------------------------------------------------
100packages =
100packages =
101− [ ("purescript-eff", "")
101+ [ ("purescript-eff", "")
102− , ("purescript-prelude", "")
102+ , ("purescript-prelude", "")
103− , ("purescript-assert", "")
103+ , ("purescript-assert", "")
104− , ("purescript-st", "")
104+ , ("purescript-st", "")
105− , ("purescript-console", "")
105+ , ("purescript-console", "")
106− , ("purescript-functions", "")
106+ , ("purescript-functions", "")
107− , ("purescript-partial", "")
107+ , ("purescript-partial", "")
108− , ("purescript-newtype", "")
108+ , ("purescript-newtype", "")
109+ , ("purescript-control", "")
110+ , ("purescript-invariant", "")
111+ , ("purescript-monoid", "")
112+ , ("purescript-generics-rep", "")
109 ]
113 ]
110
114
111-------------------------------------------------------------------------------
115-------------------------------------------------------------------------------
purescript.cabal+2−1
@@ -533,6 +533,7 @@ executable pcc
533 mtl -any,
533 mtl -any,
534 optparse-applicative >= 0.12.1,
534 optparse-applicative >= 0.12.1,
535 parsec -any,
535 parsec -any,
536+ text -any,
536 time -any,
537 time -any,
537 transformers -any,
538 transformers -any,
538 transformers-compat -any,
539 transformers-compat -any,
@@ -540,7 +541,7 @@ executable pcc
540 main-is: Main.hs
541 main-is: Main.hs
541 buildable: True
542 buildable: True
542 hs-source-dirs: pcc
543 hs-source-dirs: pcc
543− other-modules: Paths_purescript
544+ other-modules: Paths_purescript Make Makefile
544 ghc-options: -Wall -O2 -fno-warn-unused-do-bind -threaded -rtsopts "-with-rtsopts=-N"
545 ghc-options: -Wall -O2 -fno-warn-unused-do-bind -threaded -rtsopts "-with-rtsopts=-N"
545
546
546
547
src/Language/PureScript/CodeGen/Cpp.hs+1−1
@@ -795,7 +795,7 @@ moduleToCpp env (Module _ mn imps _ foreigns decls) = do
795 catMaybes . map modCtor . M.keys $ E.dataConstructors env]]
795 catMaybes . map modCtor . M.keys $ E.dataConstructors env]]
796 where
796 where
797 modCtor :: Qualified (ProperName a) -> Maybe String
797 modCtor :: Qualified (ProperName a) -> Maybe String
798− modCtor (Qualified (Just mn') (ProperName name)) | mn' == mn = Just name
798+ modCtor (Qualified (Just mn') (ProperName name)) | mn' == mn = Just $ identToCpp (Ident name)
799 modCtor _ = Nothing
799 modCtor _ = Nothing
800
800
801 -------------------------------------------------------------------------------------------------
801 -------------------------------------------------------------------------------------------------
src/Language/PureScript/CodeGen/Cpp/Optimizer.hs+1−1
@@ -89,7 +89,7 @@ optimize' nm cpp = do
89 , inlineOperator (C.dataFunction, C.apply) $ \f x -> CppApp f [x]
89 , inlineOperator (C.dataFunction, C.apply) $ \f x -> CppApp f [x]
90 , inlineOperator (C.prelude, (C.#)) $ \x f -> CppApp f [x]
90 , inlineOperator (C.prelude, (C.#)) $ \x f -> CppApp f [x]
91 , inlineOperator (C.dataFunction, C.applyFlipped) $ \x f -> CppApp f [x]
91 , inlineOperator (C.dataFunction, C.applyFlipped) $ \x f -> CppApp f [x]
92− , inlineOperator (C.dataArrayUnsafe, C.unsafeIndex) $ flip CppIndexer
92+ , inlineOperator (C.dataArray, C.unsafeIndex) $ flip CppIndexer
93 , inlineCommonOperators
93 , inlineCommonOperators
94 ]) cpp
94 ]) cpp
95
95
src/Language/PureScript/CodeGen/Cpp/Optimizer/Inliner.hs+3−3
@@ -188,9 +188,9 @@ inlineCommonOperators = applyAll $
188 , binary heytingAlgebraBoolean opDisj Or
188 , binary heytingAlgebraBoolean opDisj Or
189 , unary heytingAlgebraBoolean opNot Not
189 , unary heytingAlgebraBoolean opNot Not
190
190
191− , binary' C.dataIntBits (C..|.) BitwiseOr
191+ , binary' C.dataIntBits (C.or) BitwiseOr
192− , binary' C.dataIntBits (C..&.) BitwiseAnd
192+ , binary' C.dataIntBits (C.and) BitwiseAnd
193− , binary' C.dataIntBits (C..^.) BitwiseXor
193+ , binary' C.dataIntBits (C.xor) BitwiseXor
194 , binary' C.dataIntBits C.shl ShiftLeft
194 , binary' C.dataIntBits C.shl ShiftLeft
195 , binary' C.dataIntBits C.shr ShiftRight
195 , binary' C.dataIntBits C.shr ShiftRight
196 -- , binary' C.dataIntBits C.zshr ZeroFillShiftRight
196 -- , binary' C.dataIntBits C.zshr ZeroFillShiftRight