forked from GitHub/gf-rgl
Move everything related to synopsis into subfolder
Clean up some unused and generated files
This commit is contained in:
32
doc/synopsis/MkExx.hs
Normal file
32
doc/synopsis/MkExx.hs
Normal file
@@ -0,0 +1,32 @@
|
||||
-- make a script for computing examples
|
||||
-- usage: runghc MkExx.hs <koe.txt >koe.gfs
|
||||
-- then: gf -retain -s ../alltenses/TryRon.gfo <koe.gfs
|
||||
-- called automatically by 'make exx'
|
||||
|
||||
main = interact (unlines . concatMap mkScript . takeWhile (/="--.") . lines)
|
||||
|
||||
mkScript l = case l of
|
||||
' ':_ ->
|
||||
let ident = mkIdent $ unwords $ takeWhile (/="--") $ words l
|
||||
in [add $ psq ident]
|
||||
'-':_ -> []
|
||||
_ -> [
|
||||
add $ psq l,
|
||||
add $ "cc -one " ++ l,
|
||||
add $ psq "*"
|
||||
]
|
||||
|
||||
add = ('\n':)
|
||||
|
||||
psq s = "ps \"" ++ s ++ "\""
|
||||
|
||||
-- makes mkUtt : QS -> Utt to mkUtt-QS-Utt
|
||||
mkIdent :: String -> String
|
||||
mkIdent = concatMap unspec where
|
||||
unspec c = case c of
|
||||
' ' -> ""
|
||||
'>' -> ""
|
||||
'(' -> ""
|
||||
')' -> ""
|
||||
':' -> "-"
|
||||
_ -> [c]
|
||||
Reference in New Issue
Block a user