@@ -86,6 +86,12 @@ process _ (Eval t) = do (tm, ty) <- elabVal toplevel False t
86 logLvl 3 $ "Raw: " ++ show (tm', ty')
86 logLvl 3 $ "Raw: " ++ show (tm', ty')
87 iputStrLn (show (delab ist tm') ++ " : " ++
87 iputStrLn (show (delab ist tm') ++ " : " ++
88 show (delab ist ty'))
88 show (delab ist ty'))
89+process _ (Check t) = do (tm, ty) <- elabVal toplevel False t
92+ let ty' = normaliseC ctxt [] ty
93+ iputStrLn (show (delab ist tm) ++ " : " ++
94+ show (delab ist ty'))
89process _ (Spec t) = do (tm, ty) <- elabVal toplevel False t
95process _ (Spec t) = do (tm, ty) <- elabVal toplevel False t
90 ctxt <- getContext
96 ctxt <- getContext
91 ist <- get
97 ist <- get
@@ -101,6 +107,9 @@ process _ TTShell = do ist <- get
101 let shst = initState (tt_ctxt ist)
107 let shst = initState (tt_ctxt ist)
102 shst' <- lift $ runShell shst
108 shst' <- lift $ runShell shst
103 return ()
109 return ()
110+process _ (Execute f) = do compile f
111+ lift $ system ("./" ++ f)
104process _ (Compile f) = do compile f
113process _ (Compile f) = do compile f
105process _ (LogLvl i) = setLogLevel i
114process _ (LogLvl i) = setLogLevel i
106process _ Metavars = do ist <- get
115process _ Metavars = do ist <- get
@@ -114,7 +123,7 @@ displayHelp = let vstr = showVersion version in
114 "\nIdris version " ++ vstr ++ "\n" ++
123 "\nIdris version " ++ vstr ++ "\n" ++
115 "--------------" ++ map (\x -> '-') vstr ++ "\n\n" ++
124 "--------------" ++ map (\x -> '-') vstr ++ "\n\n" ++
116 concatMap cmdInfo help
125 concatMap cmdInfo help
117− where cmdInfo (cmds, args, text) = " " ++ col 14 14 (showSep " " cmds) args text
126+ where cmdInfo (cmds, args, text) = " " ++ col 16 12 (showSep " " cmds) args text
118 col c1 c2 l m r =
127 col c1 c2 l m r =
119 l ++ take (c1 - length l) (repeat ' ') ++
128 l ++ take (c1 - length l) (repeat ' ') ++
120 m ++ take (c2 - length m) (repeat ' ') ++ r ++ "\n"
129 m ++ take (c2 - length m) (repeat ' ') ++ r ++ "\n"
@@ -123,11 +132,13 @@ help =
123 [ (["Command"], "Arguments", "Purpose"),
132 [ (["Command"], "Arguments", "Purpose"),
124 ([""], "", ""),
133 ([""], "", ""),
125 (["<expression>"], "", "Evaluate an expression"),
134 (["<expression>"], "", "Evaluate an expression"),
135+ ([":t"], "<expression>", "Check the type of an expression"),
126 ([":r",":reload"], "", "Reload current file"),
136 ([":r",":reload"], "", "Reload current file"),
127 ([":e",":edit"], "", "Edit current file using $EDITOR or $VISUAL"),
137 ([":e",":edit"], "", "Edit current file using $EDITOR or $VISUAL"),
128 ([":m",":metavars"], "", "Show remaining proof obligations (metavariables)"),
138 ([":m",":metavars"], "", "Show remaining proof obligations (metavariables)"),
129 ([":p",":prove"], "<name>", "Prove a metavariable"),
139 ([":p",":prove"], "<name>", "Prove a metavariable"),
130 ([":c",":compile"], "<filename>", "Compile to an executable <filename>"),
140 ([":c",":compile"], "<filename>", "Compile to an executable <filename>"),
141+ ([":exec",":execute"], "<filename>", "Compile to an executable <filename> and run"),
131 ([":?",":h",":help"], "", "Display this help text"),
142 ([":?",":h",":help"], "", "Display this help text"),
132 ([":q",":quit"], "", "Exit the Idris system")
143 ([":q",":quit"], "", "Exit the Idris system")