summaryrefslogtreecommitdiff
path: root/src-3.0/GF/Command/Parse.hs
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2008-06-18 07:22:30 +0000
committeraarne <aarne@cs.chalmers.se>2008-06-18 07:22:30 +0000
commit0f21f8f3436d732838dc76da0c1005eb332961ff (patch)
treeacf77a40a85c6522bdc4fbe763a25184ee9d62b8 /src-3.0/GF/Command/Parse.hs
parent23b8136af27b0baaa8fcb5272a613d5f2ee447fa (diff)
macros for commands (dc) and terms (dt)
Diffstat (limited to 'src-3.0/GF/Command/Parse.hs')
-rw-r--r--src-3.0/GF/Command/Parse.hs10
1 files changed, 8 insertions, 2 deletions
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))