mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-28 05:52:51 -06:00
Move transfer into the GF repo.
This commit is contained in:
22
src/Transfer/Syntax/ResolveLayout.hs
Normal file
22
src/Transfer/Syntax/ResolveLayout.hs
Normal file
@@ -0,0 +1,22 @@
|
||||
module Main where
|
||||
|
||||
import System.Environment (getArgs)
|
||||
|
||||
import Transfer.Syntax.Lex
|
||||
import Transfer.Syntax.Layout
|
||||
|
||||
prTokens :: [Token] -> String
|
||||
prTokens = prTokens_ 1 1
|
||||
where
|
||||
prTokens_ _ _ [] = ""
|
||||
prTokens_ l c (PT p t:ts) =
|
||||
-- prTokens_ l c (Err p:ts) =
|
||||
|
||||
layout :: String -> String
|
||||
layout s = prTokens . resolveLayout True . tokens
|
||||
|
||||
main :: IO ()
|
||||
main = do args <- getArgs
|
||||
case args of
|
||||
[] -> getContents >>= putStrLn . layout
|
||||
fs -> mapM_ (\f -> readFile f >>= putStrLn . layout) fs
|
||||
Reference in New Issue
Block a user