git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
C++: fix issues with psc-ide compatibility (externs.json, module dir names)
commit2509d99d407d595b641417d955493270a77f148c authorAndy Arvanitis <andyarvanitis@gmail.com> dateThu 1 Dec 2016, 21:03 (10 years ago) parentc6b0b0a
2 files changed+6−6
pcc/Make.hs+5−5 src/Language/PureScript/Pretty/Cpp.hs+1−1
pcc/Make.hs+5−5
@@ -81,26 +81,26 @@ buildMakeActions outputDir filePathMap usePrefix =
8181
8282 getOutputTimestamp :: P.ModuleName -> Make (Maybe UTCTime)
8383 getOutputTimestamp mn = do
84− let filePath = dotsTo '/' $ P.runModuleName mn
84+ let filePath = P.runModuleName mn
8585 fileBase = outputDir </> filePath </> (last . words . dotsTo ' ' $ P.runModuleName mn)
8686 sourceFile = addExtension fileBase sourceExt
8787 headerFile = addExtension fileBase headerExt
88− externsFile = outputDir </> filePath </> "externs.purs"
88+ externsFile = outputDir </> filePath </> "externs.json"
8989 foldl min <$> getTimestamp externsFile <*> mapM getTimestamp [sourceFile, headerFile]
9090
9191 readExterns :: P.ModuleName -> Make (FilePath, P.Externs)
9292 readExterns mn = do
93− let path = outputDir </> (dotsTo '/' $ P.runModuleName mn) </> "externs.purs"
93+ let path = outputDir </> (P.runModuleName mn) </> "externs.json"
9494 (path, ) <$> readTextFile path
9595
9696 codegen :: CF.Module CF.Ann -> P.Environment -> P.Externs -> P.SupplyT Make ()
9797 codegen m env exts = do
9898 let mn = CF.moduleName m
99− let filePath = dotsTo '/' $ P.runModuleName mn
99+ let filePath = P.runModuleName mn
100100 fileBase = outputDir </> filePath </> (last . words . dotsTo ' ' $ P.runModuleName mn)
101101 sourceFile = addExtension fileBase sourceExt
102102 headerFile = addExtension fileBase headerExt
103− externsFile = outputDir </> filePath </> "externs.purs"
103+ externsFile = outputDir </> filePath </> "externs.json"
104104 prefix = ["Generated by pcc version " ++ showVersion Paths.version | usePrefix]
105105 cpps <- CPP.moduleToCpp env m
106106 let (hdrs,srcs) = span (/= CPP.CppEndOfHeader) cpps
src/Language/PureScript/Pretty/Cpp.hs+1−1
@@ -213,7 +213,7 @@ literals = mkPattern' match
213213 match (CppInclude path name) =
214214 let fullpath
215215 | null path = last . words . dotsTo ' ' $ name
216− | otherwise = (dotsTo '/' path) ++ '/' : (last . words . dotsTo ' ' $ name) in
216+ | otherwise = path ++ '/' : (last . words . dotsTo ' ' $ name) in
217217 fmap concat $ sequence
218218 [ return $ "#include \"" ++ fullpath ++ ".hh\""
219219 ]