@@ -25,7 +25,12 @@ import Data.Char(isSpace, toLower)
2525import qualified Data.ByteString.UTF8 as UTF8
2626
2727parseCmd :: IState -> String -> String -> Result (Either String Command)
28−parseCmd i inputname = P.runparser pCmd i inputname . dropWhile isSpace
28+parseCmd i inputname = P.runparser pCmd i inputname . trim
29+ where trim = fst . foldr f ("", True) . dropWhile isSpace
30+ where f e (xs, False) = (e : xs, False)
31+ f e (xs, True)
32+ | isSpace e = (xs, True)
33+ | otherwise = (e : xs, False)
2934
3035type CommandTable = [ ( [String], CmdArg, String
3136 , String -> P.IdrisParser (Either String Command) ) ]