summaryrefslogtreecommitdiff
path: root/src/Obs/Main.idr
blob: 5e0903e6ee1a385c7c9a80d6f86552e074e3f8b8 (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
28
29
30
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

%default total

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

partial
main : IO ()
main = do
  [_, file] <- getArgs
    | _ => usage
  defs <- parseFile file
  blk <- Abstract.printErr $ abstractBlock defs
  ctx <- Typing.printErr $ checkBlock blk
  putStrLn "Everything type checks."