@@ -174,10 +174,9 @@ pCmd :: P.IdrisParser (Either String Command)
174pCmd = choice [ do c <- cmd names; parser c
174pCmd = choice [ do c <- cmd names; parser c
175 | (names, _, _, parser) <- parserCommandsForHelp ++ parserCommands ]
175 | (names, _, _, parser) <- parserCommandsForHelp ++ parserCommands ]
176 <|> unrecognized
176 <|> unrecognized
177− <|> nop
177+ <|> nop
179 where nop = do eof; return (Right NOP)
179 where nop = do eof; return (Right NOP)
180− eval = exprArg Eval ""
181 unrecognized = do
180 unrecognized = do
182 P.lchar ':'
181 P.lchar ':'
183 cmd <- many anyChar
182 cmd <- many anyChar
@@ -205,16 +204,26 @@ noArgs cmd name = do
206 emptyArgs <|> failure
205 emptyArgs <|> failure
207+eval :: P.IdrisParser (Either String Command)
209+ t <- P.fullExpr defaultSyntax
210+ return $ Right (Eval t)
208exprArg :: (PTerm -> Command) -> String -> P.IdrisParser (Either String Command)
212exprArg :: (PTerm -> Command) -> String -> P.IdrisParser (Either String Command)
209exprArg cmd name = do
213exprArg cmd name = do
210 let noArg = do
214 let noArg = do
212 return $ Left ("Usage is :" ++ name ++ " <expression>")
216 return $ Left ("Usage is :" ++ name ++ " <expression>")
218+ let justOperator = do
219+ (op, fc) <- P.operatorFC
221+ return $ Right $ cmd (PRef fc [] (sUN op))
214 let properArg = do
223 let properArg = do
215 t <- P.fullExpr defaultSyntax
224 t <- P.fullExpr defaultSyntax
216 return $ Right (cmd t)
225 return $ Right (cmd t)
217− try noArg <|> properArg
226+ try noArg <|> try justOperator <|> properArg