From 42382d6f93066b3adc5aa5264f8fdca0de79771f Mon Sep 17 00:00:00 2001 From: bjorn Date: Tue, 29 Jan 2008 15:53:50 +0000 Subject: Merge AId and App forms in GFCCRaw. --- src/GF/GFCC/Raw/ParGFCCRaw.hs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/GF/GFCC/Raw/ParGFCCRaw.hs') 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 -- cgit v1.2.3