summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn J. Camilleri <john@johnjcamilleri.com>2020-10-09 11:56:21 +0200
committerGitHub <noreply@github.com>2020-10-09 11:56:21 +0200
commitdb5ee0b66a1db3a28dad9c74b6fe98d80729fa93 (patch)
tree7f445cc3951e138d6c617bc21facc83d8bce651d /src
parent670a58e7e724018de5624b75eeb39f04ffe12c98 (diff)
parent7b4eeb368ceaa89bdd23500822e72f1a908cffb4 (diff)
Merge pull request #78 from anka-213/solve-syntax-error-bug
Fix syntax error problem for older versions of GHC
Diffstat (limited to 'src')
-rw-r--r--src/compiler/GF/Grammar/Lexer.x8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/compiler/GF/Grammar/Lexer.x b/src/compiler/GF/Grammar/Lexer.x
index fe455c58a..bde0aa064 100644
--- a/src/compiler/GF/Grammar/Lexer.x
+++ b/src/compiler/GF/Grammar/Lexer.x
@@ -35,7 +35,7 @@ $u = [.\n] -- universal: any character
:-
"--" [.]* ; -- Toss single line comments
-"{-" ([$u # \-] | \- [$u # \}])* ("-")+ "}" ;
+"{-" ([$u # \-] | \- [$u # \}])* ("-")+ "}" ;
$white+ ;
@rsyms { tok ident }
@@ -138,7 +138,7 @@ data Token
res = eitherResIdent
eitherResIdent :: (Ident -> Token) -> Ident -> Token
-eitherResIdent tv s =
+eitherResIdent tv s =
case Map.lookup s resWords of
Just t -> t
Nothing -> tv s
@@ -285,6 +285,10 @@ instance Monad P where
POk s a -> unP (k a) s
PFailed posn err -> PFailed posn err
+#if !(MIN_VERSION_base(4,13,0))
+ -- Monad(fail) will be removed in GHC 8.8+
+ fail = Fail.fail
+#endif
instance Fail.MonadFail P where
fail msg = P $ \(_,AI posn _ _) -> PFailed posn msg