summaryrefslogtreecommitdiff
path: root/src/Obs/Main.idr
blob: 2cf10e69ee1a3a09815948255214cf6ed9843cf7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
module Obs.Main

import Obs.Abstract
import Obs.NormalForm
import Obs.Parser
import Obs.Syntax
import Obs.Term
import Obs.Typing

import System

import Text.PrettyPrint.Prettyprinter
import Text.PrettyPrint.Prettyprinter.Render.Terminal

usage : IO ()
usage = do
  () <- putStrLn "usage: obs <file>"
  exitFailure

main : IO ()
main = do
  [_, file] <- getArgs
    | _ => usage
  defs <- parseFile file
  blk <- Abstract.printErr $ abstractBlock defs
  ctx <- Typing.printErr $ checkBlock blk
  putDoc $ pretty ctx