git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Merge branch 'pure11' of github.com:pure11/purescript into pure11-0.8
4f0968cAndy Arvanitis
src/Language/PureScript/CodeGen/Cpp.hs+6−4
@@ -137,7 +137,7 @@ moduleToCpp env (Module _ mn imps _ foreigns decls) = do
137 []
137 []
138 (CppBlock (fieldLambdas fs))
138 (CppBlock (fieldLambdas fs))
139 where
139 where
140− name = qualifiedToStr (ModuleName []) id (Qualified (Just mn) ident)
140+ name = identToCpp ident
141 fields' = identToCpp <$> fields
141 fields' = identToCpp <$> fields
142 (f, fs) | (f' : fs') <- fields' = ([f'], fs')
142 (f, fs) | (f' : fs') <- fields' = ([f'], fs')
143 | otherwise = ([], [])
143 | otherwise = ([], [])
@@ -399,14 +399,16 @@ moduleToCpp env (Module _ mn imps _ foreigns decls) = do
399 binderToCpp varName done (ConstructorBinder (_, _, _, Just IsNewtype) _ _ [b]) =
399 binderToCpp varName done (ConstructorBinder (_, _, _, Just IsNewtype) _ _ [b]) =
400 binderToCpp varName done b
400 binderToCpp varName done b
401
401
402− binderToCpp varName done (ConstructorBinder (_, _, _, Just (IsConstructor ctorType fields)) _ ctor bs) = do
402+ binderToCpp varName done (ConstructorBinder (_, _, _, Just (IsConstructor ctorType fields))
403+ _
404+ (Qualified _ (ProperName ctor))
405+ bs) = do
403 cpps <- go (zip fields bs) done
406 cpps <- go (zip fields bs) done
404− let ctor' = qualifiedToStr (ModuleName []) (Ident . runProperName) ctor
405 return $ case ctorType of
407 return $ case ctorType of
406 ProductType -> cpps
408 ProductType -> cpps
407 SumType ->
409 SumType ->
408 [ CppIfElse (CppBinary Equal (CppIndexer (CppVar ctorKey) (CppVar varName))
410 [ CppIfElse (CppBinary Equal (CppIndexer (CppVar ctorKey) (CppVar varName))
409− (CppStringLiteral ctor'))
411+ (CppStringLiteral ctor))
410 (CppBlock cpps)
412 (CppBlock cpps)
411 Nothing ]
413 Nothing ]
412 where
414 where