From 0f21f8f3436d732838dc76da0c1005eb332961ff Mon Sep 17 00:00:00 2001 From: aarne Date: Wed, 18 Jun 2008 07:22:30 +0000 Subject: macros for commands (dc) and terms (dt) --- src-3.0/GF/Command/Parse.hs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src-3.0/GF/Command/Parse.hs') diff --git a/src-3.0/GF/Command/Parse.hs b/src-3.0/GF/Command/Parse.hs index f209b713b..12c88464f 100644 --- a/src-3.0/GF/Command/Parse.hs +++ b/src-3.0/GF/Command/Parse.hs @@ -20,10 +20,10 @@ pCommandLine = RP.sepBy (RP.skipSpaces >> pPipe) (RP.skipSpaces >> RP.char ';') pPipe = RP.sepBy1 (RP.skipSpaces >> pCommand) (RP.skipSpaces >> RP.char '|') pCommand = do - cmd <- pIdent + cmd <- pIdent RP.<++ (RP.char '%' >> pIdent >>= return . ('%':)) RP.skipSpaces opts <- RP.sepBy pOption RP.skipSpaces - arg <- RP.option ANoArg (fmap AExp (pExp False)) + arg <- pArgument return (Command cmd opts arg) pOption = do @@ -38,3 +38,9 @@ pValue = do pFilename = liftM2 (:) (RP.satisfy isFileFirst) (RP.munch (not . isSpace)) where isFileFirst c = not (isSpace c) && not (isDigit c) + +pArgument = + RP.option ANoArg + (fmap AExp (pExp False) + RP.<++ + (RP.munch isSpace >> RP.char '%' >> fmap AMacro pIdent)) -- cgit v1.2.3