From 39a31d07d5c70f490c04da0969716b4bd12bb6ae Mon Sep 17 00:00:00 2001 From: aarne Date: Fri, 1 Sep 2006 15:11:22 +0000 Subject: the Error type; better lexer error reporting --- src/GF/Compile/GrammarToCanon.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/GF/Compile/GrammarToCanon.hs') diff --git a/src/GF/Compile/GrammarToCanon.hs b/src/GF/Compile/GrammarToCanon.hs index de6427e82..8ca328032 100644 --- a/src/GF/Compile/GrammarToCanon.hs +++ b/src/GF/Compile/GrammarToCanon.hs @@ -194,11 +194,12 @@ redCTerm t = case t of Vr x -> checkAgain (liftM G.Arg $ redArgvar x) (liftM G.LI $ redIdent x) --- for parametrize optimization - App _ _ -> do -- only constructor applications can remain + App _ s -> do -- only constructor applications can remain (_,c,xx) <- termForm t xx' <- mapM redCTerm xx case c of QC p c -> liftM2 G.Par (redQIdent (p,c)) (return xx') + Q (IC "Predef") (IC "error") -> fail $ "error: " ++ stringFromTerm s _ -> prtBad "expected constructor head instead of" c Q p c -> liftM G.I (redQIdent (p,c)) QC p c -> liftM2 G.Par (redQIdent (p,c)) (return []) -- cgit v1.2.3