Skip to content

Commit

Permalink
Handle plain ":t" in the repl better.
Browse files Browse the repository at this point in the history
Print a message saying it requires an argument, instead of throwing a
parse error.
  • Loading branch information
sauclovian-g committed Jul 17, 2024
1 parent dd5c357 commit b84e896
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion saw/SAWScript/REPL/Command.hs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ runCommand c = case c of


typeOfCmd :: String -> REPL ()
typeOfCmd str =
typeOfCmd str
| null str = do io $ putStrLn $ "[error] :type requires an argument"
| otherwise =
do let tokens = SAWScript.Lexer.lexSAW replFileName str
expr <- case SAWScript.Parser.parseExpression tokens of
Left err -> fail (show err)
Expand Down

0 comments on commit b84e896

Please sign in to comment.