diff options
| author | aarne <aarne@cs.chalmers.se> | 2006-09-29 10:55:36 +0000 |
|---|---|---|
| committer | aarne <aarne@cs.chalmers.se> | 2006-09-29 10:55:36 +0000 |
| commit | b39ecf4c324b674918813099711aaf437d7db1df (patch) | |
| tree | 052d0b8ccb4d39dc95ffef7c184323b6f1ff2340 /src/GF/Canon/GFCC/RunGFCC.hs | |
| parent | f705205b529e7761f2ba1d0fd4ba5dcf566dbf0d (diff) | |
new constructs in gfcc, removed lambda
Diffstat (limited to 'src/GF/Canon/GFCC/RunGFCC.hs')
| -rw-r--r-- | src/GF/Canon/GFCC/RunGFCC.hs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/GF/Canon/GFCC/RunGFCC.hs b/src/GF/Canon/GFCC/RunGFCC.hs index 5caa5e8d2..d850943fb 100644 --- a/src/GF/Canon/GFCC/RunGFCC.hs +++ b/src/GF/Canon/GFCC/RunGFCC.hs @@ -5,7 +5,8 @@ import GF.Canon.GFCC.DataGFCC import GF.Canon.GFCC.AbsGFCC import GF.Canon.GFCC.ParGFCC import GF.Canon.GFCC.PrintGFCC -import GF.Data.Operations +import GF.Canon.GFCC.ErrM +--import GF.Data.Operations import Data.Map import System.Random (newStdGen) import System @@ -56,7 +57,11 @@ file2gfcc f = readFile f >>= err (error "no parse") (return . mkGFCC) . pGrammar . myLexer readExp :: String -> Exp -readExp = errVal exp0 . (pExp . myLexer) +readExp = err (const exp0) id . (pExp . myLexer) + +err f g ex = case ex of + Ok x -> g x + Bad s -> f s {- |
