diff options
| author | aarne <aarne@cs.chalmers.se> | 2006-08-28 19:36:41 +0000 |
|---|---|---|
| committer | aarne <aarne@cs.chalmers.se> | 2006-08-28 19:36:41 +0000 |
| commit | 04933ef3c9ad381b2d09b7882b4204f6ca53208c (patch) | |
| tree | 73636820fa4b8194dbe651cf9540977062c9866f /src/GF/Source/ParGF.hs | |
| parent | df370ec7f81b2f85bb1bfebfa37f2943f0027de6 (diff) | |
the EOF error changed to more informative lexer error msg
Diffstat (limited to 'src/GF/Source/ParGF.hs')
| -rw-r--r-- | src/GF/Source/ParGF.hs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/GF/Source/ParGF.hs b/src/GF/Source/ParGF.hs index ebb017d90..d106d81a3 100644 --- a/src/GF/Source/ParGF.hs +++ b/src/GF/Source/ParGF.hs @@ -3133,7 +3133,11 @@ thenM = (>>=) happyError :: [Token] -> Err a happyError ts = - Bad $ "syntax error at " ++ tokenPos ts ++ if null ts then [] else (" before " ++ unwords (map prToken (take 4 ts))) + Bad $ "syntax error at " ++ tokenPos ts ++ + case ts of + [] -> [] + [Err _] -> " due to lexer error" + _ -> (" before " ++ unwords (map prToken (take 4 ts))) myLexer = tokens {-# LINE 1 "GenericTemplate.hs" #-} |
