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:
19
examples/app/MkApp.hs
Normal file
19
examples/app/MkApp.hs
Normal 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
|
||||
|
||||
Reference in New Issue
Block a user