mirror of
https://github.com/simonmichael/hledger.git
synced 2024-09-19 02:08:01 +03:00
add support for megaparsec 8 (#1175)
This commit is contained in:
parent
473b3376ab
commit
445e8aa3cc
@ -1,4 +1,5 @@
|
||||
{-# LANGUAGE BangPatterns #-}
|
||||
{-# LANGUAGE CPP #-}
|
||||
{-# LANGUAGE FlexibleContexts #-}
|
||||
{-# LANGUAGE FlexibleInstances #-} -- new
|
||||
{-# LANGUAGE LambdaCase #-}
|
||||
@ -176,7 +177,12 @@ reparseExcerpt (SourceExcerpt offset txt) p = do
|
||||
Left errBundle -> customFailure $ ErrorReparsing $ bundleErrors errBundle
|
||||
|
||||
where
|
||||
offsetInitialState :: Int -> s -> State s
|
||||
offsetInitialState :: Int -> s ->
|
||||
#if MIN_VERSION_megaparsec(8,0,0)
|
||||
State s e
|
||||
#else
|
||||
State s
|
||||
#endif
|
||||
offsetInitialState initialOffset s = State
|
||||
{ stateInput = s
|
||||
, stateOffset = initialOffset
|
||||
@ -187,6 +193,9 @@ reparseExcerpt (SourceExcerpt offset txt) p = do
|
||||
, pstateTabWidth = defaultTabWidth
|
||||
, pstateLinePrefix = ""
|
||||
}
|
||||
#if MIN_VERSION_megaparsec(8,0,0)
|
||||
, stateParseErrors = []
|
||||
#endif
|
||||
}
|
||||
|
||||
--- * Pretty-printing custom parse errors
|
||||
|
@ -4,7 +4,7 @@ cabal-version: 1.12
|
||||
--
|
||||
-- see: https://github.com/sol/hpack
|
||||
--
|
||||
-- hash: 7338b387492cf1c078ae62d4f4c50859589b0a5549943203856880918b67d202
|
||||
-- hash: 440daf47cc4866a3723004ada26f77ffdb86d985e23844649c9a5977232a3edd
|
||||
|
||||
name: hledger-lib
|
||||
version: 1.16.99
|
||||
@ -128,7 +128,7 @@ library
|
||||
, file-embed >=0.0.10
|
||||
, filepath
|
||||
, hashtables >=1.2.3.1
|
||||
, megaparsec >=7.0.0 && <8
|
||||
, megaparsec >=7.0.0 && <8.1
|
||||
, mtl >=2.2.1
|
||||
, old-time
|
||||
, parsec >=3
|
||||
@ -180,7 +180,7 @@ test-suite doctest
|
||||
, file-embed >=0.0.10
|
||||
, filepath
|
||||
, hashtables >=1.2.3.1
|
||||
, megaparsec >=7.0.0 && <8
|
||||
, megaparsec >=7.0.0 && <8.1
|
||||
, mtl >=2.2.1
|
||||
, old-time
|
||||
, parsec >=3
|
||||
@ -235,7 +235,7 @@ test-suite unittest
|
||||
, filepath
|
||||
, hashtables >=1.2.3.1
|
||||
, hledger-lib
|
||||
, megaparsec >=7.0.0 && <8
|
||||
, megaparsec >=7.0.0 && <8.1
|
||||
, mtl >=2.2.1
|
||||
, old-time
|
||||
, parsec >=3
|
||||
|
@ -61,7 +61,7 @@ dependencies:
|
||||
- file-embed >=0.0.10
|
||||
- filepath
|
||||
- hashtables >=1.2.3.1
|
||||
- megaparsec >=7.0.0 && <8
|
||||
- megaparsec >=7.0.0 && <8.1
|
||||
- mtl >=2.2.1
|
||||
- old-time
|
||||
- parsec >=3
|
||||
|
@ -4,7 +4,7 @@ cabal-version: 1.12
|
||||
--
|
||||
-- see: https://github.com/sol/hpack
|
||||
--
|
||||
-- hash: 44e87e99fa5ad71ff9b86d3654ceb43e1d2d53151a36cf18e2b897ad54de144e
|
||||
-- hash: 856f791512f190b68f4f0e62e158d1dfa956f0fa5be963e591472ab2adfa2f4a
|
||||
|
||||
name: hledger-ui
|
||||
version: 1.16.99
|
||||
@ -79,7 +79,7 @@ executable hledger-ui
|
||||
, fsnotify >=0.2.1.2 && <0.4
|
||||
, hledger >=1.16.99 && <1.17
|
||||
, hledger-lib >=1.16.99 && <1.17
|
||||
, megaparsec >=7.0.0 && <8
|
||||
, megaparsec >=7.0.0 && <8.1
|
||||
, microlens >=0.4
|
||||
, microlens-platform >=0.2.3.1
|
||||
, pretty-show >=1.6.4
|
||||
|
@ -55,7 +55,7 @@ dependencies:
|
||||
- fsnotify >=0.2.1.2 && <0.4
|
||||
- microlens >=0.4
|
||||
- microlens-platform >=0.2.3.1
|
||||
- megaparsec >=7.0.0 && <8
|
||||
- megaparsec >=7.0.0 && <8.1
|
||||
- pretty-show >=1.6.4
|
||||
- process >=1.2
|
||||
- safe >=0.2
|
||||
|
@ -1,10 +1,10 @@
|
||||
cabal-version: 1.12
|
||||
|
||||
-- This file has been generated from package.yaml by hpack version 0.32.0.
|
||||
-- This file has been generated from package.yaml by hpack version 0.31.2.
|
||||
--
|
||||
-- see: https://github.com/sol/hpack
|
||||
--
|
||||
-- hash: a9a6dea39ea5c963970cda9f595e7c4251332954aacd137fb6638a1e7640ee59
|
||||
-- hash: cbf332de4147396a82198ccf5173db10b775ed99f9830e89aea475bfd4da5a7f
|
||||
|
||||
name: hledger-web
|
||||
version: 1.16.99
|
||||
@ -174,7 +174,7 @@ library
|
||||
, http-client
|
||||
, http-conduit
|
||||
, http-types
|
||||
, megaparsec >=7.0.0 && <8
|
||||
, megaparsec >=7.0.0 && <8.1
|
||||
, mtl >=2.2.1
|
||||
, network
|
||||
, semigroups
|
||||
|
@ -118,7 +118,7 @@ library:
|
||||
- http-conduit
|
||||
- http-client
|
||||
- http-types
|
||||
- megaparsec >=7.0.0 && <8
|
||||
- megaparsec >=7.0.0 && <8.1
|
||||
- mtl >=2.2.1
|
||||
- network
|
||||
- semigroups
|
||||
|
@ -4,7 +4,7 @@ cabal-version: 1.12
|
||||
--
|
||||
-- see: https://github.com/sol/hpack
|
||||
--
|
||||
-- hash: dccfd747a09ddc253d2352befe0f49e195ea409c4df838416389f0baaafab8de
|
||||
-- hash: 6ff98e6e17e5d1edb014822f62c4dfeb4b7aef757c434a9a45913640fcc7f845
|
||||
|
||||
name: hledger
|
||||
version: 1.16.99
|
||||
@ -164,7 +164,7 @@ library
|
||||
, hledger-lib >=1.16.99 && <1.17
|
||||
, lucid
|
||||
, math-functions >=0.2.0.0
|
||||
, megaparsec >=7.0.0 && <8
|
||||
, megaparsec >=7.0.0 && <8.1
|
||||
, mtl >=2.2.1
|
||||
, old-time
|
||||
, parsec >=3
|
||||
@ -215,7 +215,7 @@ executable hledger
|
||||
, hledger
|
||||
, hledger-lib >=1.16.99 && <1.17
|
||||
, math-functions >=0.2.0.0
|
||||
, megaparsec >=7.0.0 && <8
|
||||
, megaparsec >=7.0.0 && <8.1
|
||||
, mtl >=2.2.1
|
||||
, old-time
|
||||
, parsec >=3
|
||||
@ -267,7 +267,7 @@ test-suite unittest
|
||||
, hledger
|
||||
, hledger-lib >=1.16.99 && <1.17
|
||||
, math-functions >=0.2.0.0
|
||||
, megaparsec >=7.0.0 && <8
|
||||
, megaparsec >=7.0.0 && <8.1
|
||||
, mtl >=2.2.1
|
||||
, old-time
|
||||
, parsec >=3
|
||||
@ -318,7 +318,7 @@ benchmark bench
|
||||
, hledger-lib >=1.16.99 && <1.17
|
||||
, html
|
||||
, math-functions >=0.2.0.0
|
||||
, megaparsec >=7.0.0 && <8
|
||||
, megaparsec >=7.0.0 && <8.1
|
||||
, mtl >=2.2.1
|
||||
, old-time
|
||||
, parsec >=3
|
||||
|
@ -119,7 +119,7 @@ dependencies:
|
||||
- extra >=1.6.3
|
||||
- filepath
|
||||
- haskeline >=0.6
|
||||
- megaparsec >=7.0.0 && <8
|
||||
- megaparsec >=7.0.0 && <8.1
|
||||
- mtl >=2.2.1
|
||||
- old-time
|
||||
- parsec >=3
|
||||
|
Loading…
Reference in New Issue
Block a user