mirror of
https://github.com/GaloisInc/cryptol.git
synced 2024-11-14 11:16:33 +03:00
32 lines
695 B
Haskell
Executable File
32 lines
695 B
Haskell
Executable File
#!/usr/bin/env runhaskell
|
|
|
|
-- |
|
|
-- Module : $Header$
|
|
-- Copyright : (c) 2013-2016 Galois, Inc.
|
|
-- License : BSD3
|
|
-- Maintainer : cryptol@galois.com
|
|
-- Stability : provisional
|
|
-- Portability : portable
|
|
|
|
import Cryptol.Parser
|
|
import Cryptol.Parser.AST(noPos)
|
|
import Cryptol.Parser.NoPat
|
|
import Cryptol.Utils.PP
|
|
|
|
import System.Process(readProcess)
|
|
import System.IO(hPrint,stderr)
|
|
|
|
main :: IO ()
|
|
main =
|
|
do txt <- getContents
|
|
let mb = parseProgram Layout txt
|
|
case mb of
|
|
Left err -> hPrint stderr $ ppError err
|
|
Right p ->
|
|
case removePatterns p of
|
|
(p1,[]) -> print $ pp p1
|
|
(_,errs) -> hPrint stderr $ vcat $ map pp errs
|
|
|
|
|
|
|