summaryrefslogtreecommitdiff
path: root/examples/app/MkApp.hs
diff options
context:
space:
mode:
authoraarne <aarne@chalmers.se>2014-04-09 14:01:06 +0000
committeraarne <aarne@chalmers.se>2014-04-09 14:01:06 +0000
commit88cf84613e2272c5296c3a3bcad37329a3ed46d0 (patch)
treeaab86904f94bd5ab869aae252e0244b2db44cad0 /examples/app/MkApp.hs
parenta3921bffd777c99f83706a2879628a986c1d3e14 (diff)
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.
Diffstat (limited to 'examples/app/MkApp.hs')
-rw-r--r--examples/app/MkApp.hs19
1 files changed, 19 insertions, 0 deletions
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
+