From c922c4eb59493bbc73add331a348230978d0d036 Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Wed, 11 May 2016 11:02:46 +0200 Subject: [PATCH] hoi --- examples/codeGen.spl | 2 +- gen.icl | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/codeGen.spl b/examples/codeGen.spl index fe4c77f..658ea6e 100644 --- a/examples/codeGen.spl +++ b/examples/codeGen.spl @@ -4,4 +4,4 @@ f() { main() { var x = 3; return 1 + 2 + x + f(); -} \ No newline at end of file +} diff --git a/gen.icl b/gen.icl index 0fc8bc0..269ef14 100644 --- a/gen.icl +++ b/gen.icl @@ -1,6 +1,5 @@ implementation module gen - import StdMisc import StdList import StdOverloaded @@ -44,7 +43,7 @@ FALSE :== 0 :: Gen a :== RWST Label SSMProgram (GenMap, [Label]) (Either GenError) a labelStream :: [Label] -labelStream = map (\i-> concat ["lbl_", toString i]) [1..] +labelStream = ["lbl_" +++ toString i\\i<-[1..]] gen :: AST -> String gen (AST fds) = case evalRWST prog "" ('Map'.newMap, labelStream) of @@ -76,6 +75,7 @@ gen (AST fds) = case evalRWST prog "" ('Map'.newMap, labelStream) of //helper functions for the gen monad genMap :: Gen GenMap genMap = gets fst + changeGenMap :: (GenMap -> GenMap) -> Gen GenMap changeGenMap f = modify (appFst f) >>| genMap @@ -218,4 +218,4 @@ instance toString Arg where toString (Raw s) = s instance toString SSMProgram where - toString p = concat $ intersperse " " $ map (\i-> concat $ intersperse " " $ print i) p \ No newline at end of file + toString p = concat $ intersperse " " $ map (\i-> concat $ intersperse " " $ print i) p -- 2.20.1