update to megaparsec-9.6.1 (#1609)

* Update to `megaparsec-9.6.1`.  This allows us to remove any annoying workaround. 
* Bump stack resolver to LTS-21.19.
* Drop support for GHC 8.10.
This commit is contained in:
Brent Yorgey 2023-11-08 12:26:23 -06:00 committed by GitHub
parent d63e7d81ef
commit 96d3062550
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 25 deletions

View File

@ -77,11 +77,6 @@ jobs:
compilerVersion: 9.0.2
setup-method: ghcup
allow-failure: false
- compiler: ghc-8.10.7
compilerKind: ghc
compilerVersion: 8.10.7
setup-method: ghcup
allow-failure: false
fail-fast: false
steps:
- name: apt

View File

@ -18,7 +18,6 @@ queue_rules:
- check-success=Haskell-CI - Linux - ghc-9.4.5
- check-success=Haskell-CI - Linux - ghc-9.2.7
- check-success=Haskell-CI - Linux - ghc-9.0.2
- check-success=Haskell-CI - Linux - ghc-8.10.7
pull_request_rules:
- actions:
@ -49,7 +48,6 @@ pull_request_rules:
- check-success=Haskell-CI - Linux - ghc-9.4.5
- check-success=Haskell-CI - Linux - ghc-9.2.7
- check-success=Haskell-CI - Linux - ghc-9.0.2
- check-success=Haskell-CI - Linux - ghc-8.10.7
- label=merge me
- ! '#approved-reviews-by>=1'
- ! '#changes-requested-reviews-by=0'

View File

@ -60,6 +60,7 @@ import Text.Megaparsec hiding (runParser)
import Text.Megaparsec.Char
import Text.Megaparsec.Char.Lexer qualified as L
import Text.Megaparsec.Pos qualified as Pos
import Text.Megaparsec.State (initialPosState, initialState)
import Witch
-- Imports for doctests (cabal-docspec needs this)
@ -486,24 +487,13 @@ runParserTH (file, line, col) p s =
Left err -> fail $ errorBundlePretty err
Right e -> return e
where
-- This is annoying --- megaparsec does not export its function to
-- construct an initial parser state, so we can't just use that
-- and then change the one field we need to be different (the
-- 'pstateSourcePos'). We have to copy-paste the whole thing.
initState :: State Text Void
initState =
State
{ stateInput = from s
, stateOffset = 0
, statePosState =
PosState
{ pstateInput = from s
, pstateOffset = 0
, pstateSourcePos = SourcePos file (mkPos line) (mkPos col)
, pstateTabWidth = defaultTabWidth
, pstateLinePrefix = ""
(initialState file (from s))
{ statePosState =
(initialPosState file (from s))
{ pstateSourcePos = SourcePos file (mkPos line) (mkPos col)
}
, stateParseErrors = []
}
-- | Parse some input 'Text' completely as a 'Term', consuming leading

View File

@ -10,6 +10,7 @@ extra-deps:
# breaking changes; see https://github.com/swarm-game/swarm/issues/1350
- lsp-1.6.0.0
- lsp-types-1.6.0.0
- megaparsec-9.6.1
- AhoCorasick-0.0.4
resolver: lts-21.0
resolver: lts-21.19

View File

@ -32,7 +32,7 @@ maintainer: byorgey@gmail.com
bug-reports: https://github.com/swarm-game/swarm/issues
copyright: Brent Yorgey 2021
category: Game
tested-with: GHC ==8.10.7 || ==9.0.2 || ==9.2.7 || ==9.4.5 || ==9.6.2
tested-with: GHC ==9.0.2 || ==9.2.7 || ==9.4.5 || ==9.6.2
extra-source-files: CHANGELOG.md
example/*.sw
editors/emacs/*.el
@ -277,7 +277,7 @@ library
lens >= 4.19 && < 5.3,
linear >= 1.21.6 && < 1.23,
lsp >= 1.6 && < 1.7,
megaparsec >= 9.0 && < 9.6,
megaparsec >= 9.6.1 && < 9.7,
minimorph >= 0.3 && < 0.4,
transformers >= 0.5 && < 0.7,
mtl >= 2.2.2 && < 2.4,