git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
More generated names tweaks
commit73a8b529fb4b68c514e3264dd73fa888a24d352b authorAndy Arvanitis <andyarvanitis@gmail.com> dateThu 25 Jul 2019, 21:18 (7 years ago) parent7143d57
3 files changed+10−8
src/CodeGen/IL/Common.hs−3 src/CodeGen/IL/Optimizer/TCO.hs+8−5 src/CodeGen/IL/Printer.hs+2
src/CodeGen/IL/Common.hs−3
@@ -174,9 +174,6 @@ string = "string"
174174arrayLengthFn :: Text
175175arrayLengthFn = "Length"
176176
177−tcoLoop :: Text
178−tcoLoop = "ᵗᶜloop"
179−
180177freshName' :: MonadSupply m => m Text
181178freshName' = do
182179 name <- freshName
src/CodeGen/IL/Optimizer/TCO.hs+8−5
@@ -1,4 +1,4 @@
1−module CodeGen.IL.Optimizer.TCO (tco) where
1+module CodeGen.IL.Optimizer.TCO (tco, tcoLoop) where
22
33import Prelude.Compat
44
@@ -11,19 +11,22 @@ import CodeGen.IL.Common
1111
1212import qualified Language.PureScript.Constants as C
1313
14+tcoLoop :: Text
15+tcoLoop = "__tco_loop"
16+
1417tco :: AST -> AST -> AST
1518tco mn = everywhere convert where
1619 tcoVar :: Text -> Text
17− tcoVar arg = "ᵗ" <> arg
20+ tcoVar arg = "__tco_var_" <> arg
1821
1922 copyVar :: Text -> Text
20− copyVar arg = "ᶜ" <> arg
23+ copyVar arg = "__copy_" <> arg
2124
2225 tcoDone :: Text
23− tcoDone = "ᵗᶜdone"
26+ tcoDone = "__tco_done"
2427
2528 tcoResult :: Text
26− tcoResult = "ᵗᶜresult"
29+ tcoResult = "__tco_result"
2730
2831 convert :: AST -> AST
2932 convert fn@(Function ss (Just name) args _)
src/CodeGen/IL/Printer.hs+2
@@ -30,7 +30,9 @@ import Language.PureScript.Crash
3030import Language.PureScript.Names (Ident, runIdent)
3131import Language.PureScript.Pretty.Common
3232import Language.PureScript.PSString (PSString, decodeString, mkString)
33+
3334import CodeGen.IL.Common
35+import CodeGen.IL.Optimizer.TCO (tcoLoop)
3436
3537import qualified Language.PureScript.Constants as C
3638