Skip to content

Commit a78ce84

Browse files
committed
clean up, update changelog
1 parent b78b6cb commit a78ce84

File tree

6 files changed

+31
-14
lines changed

6 files changed

+31
-14
lines changed

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
### Unreleased
2+
* Restructure parsing-related modules for code deduplication and better user
3+
experience.
4+
* Now all user-facing parsers and the combinators to create them are in a
5+
single module at `Language.Fortran.Parser`.
6+
* The Happy parsers have fewer dependencies, so should no longer require a
7+
recompile due to apparently unrelated changes.
8+
* Remove some deprecated shims (from the restructured modules).
9+
110
### 0.8.0 (Jan 04, 2022)
211
* Merge declarator constructors. Now you differentiate between array and
312
scalar declarators by looking at the relevant field. See

fortran-src.cabal

+3-3
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ library
136136
, containers >=0.5 && <0.7
137137
, deepseq ==1.4.*
138138
, directory >=1.2 && <2
139-
, either
139+
, either >=5.0.1.1 && <5.1
140140
, fgl ==5.*
141141
, filepath ==1.4.*
142142
, mtl >=2.2 && <3
@@ -181,7 +181,7 @@ executable fortran-src
181181
, containers >=0.5 && <0.7
182182
, deepseq ==1.4.*
183183
, directory >=1.2 && <2
184-
, either
184+
, either >=5.0.1.1 && <5.1
185185
, fgl ==5.*
186186
, filepath ==1.4.*
187187
, fortran-src
@@ -258,7 +258,7 @@ test-suite spec
258258
, containers >=0.5 && <0.7
259259
, deepseq ==1.4.*
260260
, directory >=1.2 && <2
261-
, either
261+
, either >=5.0.1.1 && <5.1
262262
, fgl ==5.*
263263
, filepath ==1.4.*
264264
, fortran-src

package.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ dependencies:
6363
- deepseq >=1.4 && <1.5
6464
- filepath >=1.4 && <1.5
6565
- temporary >=1.2 && <1.4
66-
- either # TODO
66+
- either ^>=5.0.1.1
6767

6868
# --pedantic for building (not used for stack ghci)
6969
ghc-options:

src/Language/Fortran/AST/Boz.hs

+4-5
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,10 @@ bozAsNatural :: (Num a, Eq a) => Boz -> a
8888
bozAsNatural (Boz pfx str) = runReadS $ parser str
8989
where
9090
runReadS = fst . head
91-
parser = case pfx of
92-
BozPrefixB -> -- TODO on GHC 9.2, 'Num.readBin'
93-
Num.readInt 2 (const True) binDigitVal
94-
BozPrefixO -> Num.readOct
95-
BozPrefixZ -> Num.readHex
91+
parser = case pfx of BozPrefixB -> Num.readInt 2 (const True) binDigitVal
92+
-- (on GHC >=9.2, 'Num.readBin')
93+
BozPrefixO -> Num.readOct
94+
BozPrefixZ -> Num.readHex
9695
binDigitVal = \case '0' -> 0
9796
'1' -> 1
9897
_ -> error "Language.Fortran.AST.BOZ.bozAsNatural: invalid BOZ string"

src/Language/Fortran/Version.hs

-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ module Language.Fortran.Version
55
, fortranVersionAliases
66
, selectFortranVersion
77
, deduceFortranVersion
8-
, deduceVersion -- deprecated
98
) where
109

1110
import Data.Char (toLower)
@@ -74,7 +73,3 @@ deduceFortranVersion path
7473
| otherwise = Fortran90 -- unrecognized, default to F90
7574
where
7675
isExtensionOf = flip isSuffixOf $ map toLower path
77-
78-
-- | Alias for previous function name. TODO: deprecate eventually.
79-
deduceVersion :: FilePath -> FortranVersion
80-
deduceVersion = deduceFortranVersion

upgrade-guide.md

+14
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
11
# fortran-src upgrade guide
2+
## Unreleased
3+
### Parser restructure
4+
***Necessitates changes.***
5+
6+
Instead of grabbing parsers directly from `Language.Fortran.Parser.FortranXYZ`,
7+
import `Language.Fortran.Parser` qualified and use one of the many provided
8+
functions. If you need to do more complex parser incantations, we recommend
9+
using the combinators in `Parser`.
10+
11+
In general, `parserVersions` and the parsers exported from respective parser
12+
modules can be replaced by `Parser.byVer`, `Parser.f77e` etc. The filepath
13+
argument now comes before the contents bytestring, so you may have to swap
14+
argument order (done to match other parsing libraries and most common usage).
15+
216
## Release 0.8.0
317
### Declarator constructor refactor
418
***Necessitates changes.***

0 commit comments

Comments
 (0)