Skip to content

Commit f29df32

Browse files
committed
Agda 2.6.4.3 compatibility
1 parent 8505671 commit f29df32

File tree

5 files changed

+33
-7
lines changed

5 files changed

+33
-7
lines changed

src/Agda/Interaction/Imports/More.hs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,14 @@ import Agda.Syntax.Common.Pretty (Pretty, pretty, text, prettyAssign, (<+>))
6262
import Agda.TypeChecking.Monad
6363
( Interface,
6464
TCM,
65-
checkAndSetOptionsFromPragma,
6665
setCurrentRange,
6766
setOptionsFromPragma,
6867
setTCLens,
6968
stPragmaOptions,
7069
useTC,
70+
#if MIN_VERSION_Agda(2,7,0)
71+
checkAndSetOptionsFromPragma,
72+
#endif
7173
#if MIN_VERSION_Agda(2,8,0)
7274
runPM,
7375
runPMDropWarnings,
@@ -146,9 +148,13 @@ setOptionsFromSourcePragmas checkOpts src = do
146148
mapM_ setOpts (srcDefaultPragmas src)
147149
mapM_ setOpts (srcFilePragmas src)
148150
where
151+
#if MIN_VERSION_Agda(2,7,0)
149152
setOpts
150153
| checkOpts = checkAndSetOptionsFromPragma
151154
| otherwise = setOptionsFromPragma
155+
#else
156+
setOpts = setOptionsFromPragma
157+
#endif
152158

153159
-- Andreas, 2016-07-11, issue 2092
154160
-- The error range should be set to the file with the wrong module name

src/Agda/Syntax/Abstract/More.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import Agda.Syntax.Abstract
77
import Agda.Syntax.Common
88
import Agda.Syntax.Common (ArgInfo (argInfoOrigin))
99
import Agda.Syntax.Common.Pretty
10-
import Agda.Syntax.Concrete (TacticAttribute' (theTacticAttribute))
1110
import Agda.Syntax.Info
1211
import Agda.Utils.Functor ((<&>))
1312
import Data.Foldable (Foldable (toList))

src/Indexer/Indexer.hs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,11 @@ instance Indexable A.Declaration where
136136
index decls
137137
A.PatternSynDef name bindings pat -> do
138138
tellDecl name PatternSyn UnknownType
139+
#if MIN_VERSION_Agda(2,7,0)
139140
forM_ bindings $ \(C.WithHiding _hiding binding) ->
141+
#else
142+
forM_ bindings $ \(C.Arg _argInfo binding) ->
143+
#endif
140144
tellDef binding Param UnknownType
141145
let pat' :: A.Pattern = fmap absurd pat
142146
index pat'
@@ -302,7 +306,11 @@ instance (Indexable a) => Indexable (C.Arg a) where
302306
when (C.argInfoOrigin argInfo == C.UserWritten) $
303307
index x
304308

309+
#if MIN_VERSION_Agda(2,7,0)
305310
instance Indexable A.TacticAttribute
311+
#else
312+
instance (Indexable a) => Indexable (C.Ranged a)
313+
#endif
306314

307315
instance Indexable A.DefInfo where
308316
index = index . Info.defTactic
@@ -391,10 +399,12 @@ instance Indexable A.RewriteEqn where
391399
tellDef bindName Param UnknownType
392400
index pat
393401
index expr
402+
#if MIN_VERSION_Agda(2,7,0)
394403
C.LeftLet bindings ->
395404
forM_ bindings $ \(pat, expr) -> do
396405
index pat
397406
index expr
407+
#endif
398408

399409
instance Indexable A.RHS where
400410
index rhs = case rhs of
@@ -556,18 +566,20 @@ instance Indexable A.Pragma where
556566
tellUsage name
557567
A.InjectivePragma name ->
558568
tellUsage name
559-
A.InjectiveForInferencePragma name ->
560-
tellUsage name
561569
A.InlinePragma _shouldInline name ->
562570
tellUsage name
563571
A.NotProjectionLikePragma name ->
564572
tellUsage name
565-
A.OverlapPragma name _overlapMode ->
566-
tellUsage name
567573
A.DisplayPragma name args displayExpr -> do
568574
tellUsage name
569575
indexNamedArgs name args
570576
index displayExpr
577+
#if MIN_VERSION_Agda(2,7,0)
578+
A.InjectiveForInferencePragma name ->
579+
tellUsage name
580+
A.OverlapPragma name _overlapMode ->
581+
tellUsage name
582+
#endif
571583

572584
--------------------------------------------------------------------------------
573585

src/Server/Model/Handler.hs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# LANGUAGE CPP #-}
12
{-# LANGUAGE DataKinds #-}
23
{-# LANGUAGE FlexibleContexts #-}
34
{-# LANGUAGE KindSignatures #-}
@@ -26,6 +27,10 @@ import qualified Language.LSP.Server as LSP
2627
import Monad (ServerM, askModel, catchTCError, findAgdaLib)
2728
import qualified Server.Model as Model
2829
import Server.Model.Monad (WithAgdaFileM, WithAgdaLibM, runWithAgdaFileT, runWithAgdaLibT)
30+
#if MIN_VERSION_Agda(2,7,0)
31+
#else
32+
import Agda.TypeChecking.Errors ()
33+
#endif
2934

3035
tryTC :: ServerM a -> ServerM (Either TCM.TCErr a)
3136
tryTC handler = (Right <$> handler) `catchTCError` (return . Left)

src/Server/Model/Monad.hs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ module Server.Model.Monad
2525
where
2626

2727
import Agda.Interaction.Options (CommandLineOptions (optPragmaOptions), PragmaOptions)
28-
import Agda.Interaction.Response (Response_boot (Resp_HighlightingInfo))
2928
import Agda.Syntax.Common.Pretty (prettyShow)
3029
import Agda.Syntax.Position (getRange)
3130
import Agda.TypeChecking.Monad (HasOptions (..), MonadTCEnv (..), MonadTCM (..), MonadTCState (..), MonadTrace, PersistentTCState (stPersistentOptions), ReadTCState (..), TCEnv (..), TCM, TCMT (..), TCState (stPersistentState), catchError_, modifyTCLens, setTCLens, stPragmaOptions, useTC, viewTC)
@@ -54,6 +53,11 @@ import Prelude hiding (null)
5453
#if MIN_VERSION_Agda(2,8,0)
5554
import Agda.Utils.FileId (File, getIdFile)
5655
#endif
56+
#if MIN_VERSION_Agda(2,7,0)
57+
import Agda.Interaction.Response (Response_boot(Resp_HighlightingInfo))
58+
#else
59+
import Agda.Interaction.Response (Response(Resp_HighlightingInfo))
60+
#endif
5761

5862
--------------------------------------------------------------------------------
5963

0 commit comments

Comments
 (0)