summaryrefslogtreecommitdiff
path: root/src-3.0/GF/Command/Parse.hs
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2008-06-12 21:04:16 +0000
committeraarne <aarne@cs.chalmers.se>2008-06-12 21:04:16 +0000
commit3b15ade685f0281d67eba079391981a822e68a23 (patch)
tree802fff6c3ec1c60c9df6d9e721dacce45a6cb55c /src-3.0/GF/Command/Parse.hs
parent4369e679986fb602180b03f461105b9b3a2fdce2 (diff)
file name as option in commands
Diffstat (limited to 'src-3.0/GF/Command/Parse.hs')
-rw-r--r--src-3.0/GF/Command/Parse.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src-3.0/GF/Command/Parse.hs b/src-3.0/GF/Command/Parse.hs
index 34988632d..5a0deaaf5 100644
--- a/src-3.0/GF/Command/Parse.hs
+++ b/src-3.0/GF/Command/Parse.hs
@@ -5,6 +5,7 @@ import PGF.Data(Exp)
import GF.Command.Abstract
import Data.Char
+import Control.Monad
import qualified Text.ParserCombinators.ReadP as RP
readCommandLine :: String -> Maybe CommandLine
@@ -32,6 +33,9 @@ pOption = do
RP.option (OOpt flg) (fmap (OFlag flg) (RP.char '=' >> pValue))
pValue = do
- fmap VId pIdent
+ fmap VId pFilename
RP.<++
fmap (VInt . read) (RP.munch1 isDigit)
+
+pFilename = liftM2 (:) (RP.satisfy isFileFirst) (RP.munch (not . isSpace)) where
+ isFileFirst c = not (isSpace c) && not (isDigit c)