diff options
| author | bjorn <bjorn@bringert.net> | 2008-01-29 15:53:50 +0000 |
|---|---|---|
| committer | bjorn <bjorn@bringert.net> | 2008-01-29 15:53:50 +0000 |
| commit | 42382d6f93066b3adc5aa5264f8fdca0de79771f (patch) | |
| tree | ee64e955d02cdac91f5f42826386c8123d685678 /src/GF/GFCC/Raw/ParGFCCRaw.hs | |
| parent | 730a9905f3ae44d2349649187dd49792bd8f1973 (diff) | |
Merge AId and App forms in GFCCRaw.
Diffstat (limited to 'src/GF/GFCC/Raw/ParGFCCRaw.hs')
| -rw-r--r-- | src/GF/GFCC/Raw/ParGFCCRaw.hs | 11 |
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 |
