From 88cf84613e2272c5296c3a3bcad37329a3ed46d0 Mon Sep 17 00:00:00 2001 From: aarne Date: Wed, 9 Apr 2014 14:01:06 +0000 Subject: more passives in App. Import changes are now produced with MkApp.hs, which copies the exclude list from App.gf to the concrete syntax files. --- examples/app/MkApp.hs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 examples/app/MkApp.hs (limited to 'examples/app/MkApp.hs') diff --git a/examples/app/MkApp.hs b/examples/app/MkApp.hs new file mode 100644 index 000000000..02bc89f96 --- /dev/null +++ b/examples/app/MkApp.hs @@ -0,0 +1,19 @@ +-- update the import list of every language + +langs = words "Bul Chi Eng Fin Fre Ger Hin Ita Spa Swe" +appCnc lang = "App" ++ lang ++ ".gf" + +appAbs = "App.gf" + +main = do + imports <- readFile appAbs >>= return . getImports + mapM_ (\f -> readFile f >>= writeFile ("tmp/" ++ f) . (putImports imports)) (map appCnc langs) + +getImports = takeWhile (/= ']') . tail . dropWhile (/='[') + +putImports i s = + let + (s1,_:s2) = span (/='[') s + (_, s3) = span (/=']') s2 + in s1 ++ "[" ++ i ++ s3 + -- cgit v1.2.3