1
0
forked from GitHub/gf-core

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.

This commit is contained in:
aarne
2014-04-09 14:01:06 +00:00
parent 6d6d641b73
commit 6c7f1245ce
12 changed files with 51 additions and 33 deletions

19
examples/app/MkApp.hs Normal file
View File

@@ -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