@@ -174,10 +174,9 @@ pCmd :: P.IdrisParser (Either String Command)
174174pCmd = choice [ do c <- cmd names; parser c
175175 | (names, _, _, parser) <- parserCommandsForHelp ++ parserCommands ]
176176 <|> unrecognized
177− <|> nop
177+ <|> nop
178178 <|> eval
179179 where nop = do eof; return (Right NOP)
180− eval = exprArg Eval ""
181180 unrecognized = do
182181 P.lchar ':'
183182 cmd <- many anyChar
@@ -205,16 +204,26 @@ noArgs cmd name = do
205204
206205 emptyArgs <|> failure
207206
207+eval :: P.IdrisParser (Either String Command)
208+eval = do
209+ t <- P.fullExpr defaultSyntax
210+ return $ Right (Eval t)
211+
208212exprArg :: (PTerm -> Command) -> String -> P.IdrisParser (Either String Command)
209213exprArg cmd name = do
210214 let noArg = do
211215 eof
212216 return $ Left ("Usage is :" ++ name ++ " <expression>")
213217
218+ let justOperator = do
219+ (op, fc) <- P.operatorFC
220+ eof
221+ return $ Right $ cmd (PRef fc [] (sUN op))
222+
214223 let properArg = do
215224 t <- P.fullExpr defaultSyntax
216225 return $ Right (cmd t)
217− try noArg <|> properArg
226+ try noArg <|> try justOperator <|> properArg
218227
219228
220229