mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-24 03:52:50 -06:00
file name as option in commands
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user