summaryrefslogtreecommitdiff
path: root/src/GF/GFCC/Raw/ParGFCCRaw.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/GF/GFCC/Raw/ParGFCCRaw.hs')
-rw-r--r--src/GF/GFCC/Raw/ParGFCCRaw.hs11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/GF/GFCC/Raw/ParGFCCRaw.hs b/src/GF/GFCC/Raw/ParGFCCRaw.hs
index 455b2713a..06ed83c04 100644
--- a/src/GF/GFCC/Raw/ParGFCCRaw.hs
+++ b/src/GF/GFCC/Raw/ParGFCCRaw.hs
@@ -14,13 +14,12 @@ pGrammar :: P Grammar
pGrammar = liftM Grm pTerms
pTerms :: P [RExp]
-pTerms = liftM2 (:) pTerm pTerms <++ (skipSpaces >> return [])
+pTerms = liftM2 (:) (pTerm 1) pTerms <++ (skipSpaces >> return [])
-pTerm :: P RExp
-pTerm = skipSpaces >> (pApp <++ pId <++ pNum <++ pStr <++ pMeta)
- where pApp = between (char '(') (char ')')
- (liftM2 App pIdent pTerms)
- pId = liftM AId pIdent
+pTerm :: Int -> P RExp
+pTerm n = skipSpaces >> (pParen <++ pApp <++ pNum <++ pStr <++ pMeta)
+ where pParen = between (char '(') (char ')') (pTerm 0)
+ pApp = liftM2 App pIdent (if n == 0 then pTerms else return [])
pStr = char '"' >> liftM AStr (manyTill (pEsc <++ get) (char '"'))
-- FIXME: what escapes are used?
pEsc = char '\\' >> get