File tree 6 files changed +31
-14
lines changed
6 files changed +31
-14
lines changed Original file line number Diff line number Diff line change
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
+
1
10
### 0.8.0 (Jan 04, 2022)
2
11
* Merge declarator constructors. Now you differentiate between array and
3
12
scalar declarators by looking at the relevant field. See
Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ library
136
136
, containers >= 0.5 && < 0.7
137
137
, deepseq == 1.4. *
138
138
, directory >= 1.2 && < 2
139
- , either
139
+ , either >= 5.0.1.1 && < 5.1
140
140
, fgl == 5. *
141
141
, filepath == 1.4. *
142
142
, mtl >= 2.2 && < 3
@@ -181,7 +181,7 @@ executable fortran-src
181
181
, containers >= 0.5 && < 0.7
182
182
, deepseq == 1.4. *
183
183
, directory >= 1.2 && < 2
184
- , either
184
+ , either >= 5.0.1.1 && < 5.1
185
185
, fgl == 5. *
186
186
, filepath == 1.4. *
187
187
, fortran-src
@@ -258,7 +258,7 @@ test-suite spec
258
258
, containers >= 0.5 && < 0.7
259
259
, deepseq == 1.4. *
260
260
, directory >= 1.2 && < 2
261
- , either
261
+ , either >= 5.0.1.1 && < 5.1
262
262
, fgl == 5. *
263
263
, filepath == 1.4. *
264
264
, fortran-src
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ dependencies:
63
63
- deepseq >=1.4 && <1.5
64
64
- filepath >=1.4 && <1.5
65
65
- temporary >=1.2 && <1.4
66
- - either # TODO
66
+ - either ^>=5.0.1.1
67
67
68
68
# --pedantic for building (not used for stack ghci)
69
69
ghc-options :
Original file line number Diff line number Diff line change @@ -88,11 +88,10 @@ bozAsNatural :: (Num a, Eq a) => Boz -> a
88
88
bozAsNatural (Boz pfx str) = runReadS $ parser str
89
89
where
90
90
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
96
95
binDigitVal = \ case ' 0' -> 0
97
96
' 1' -> 1
98
97
_ -> error " Language.Fortran.AST.BOZ.bozAsNatural: invalid BOZ string"
Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ module Language.Fortran.Version
5
5
, fortranVersionAliases
6
6
, selectFortranVersion
7
7
, deduceFortranVersion
8
- , deduceVersion -- deprecated
9
8
) where
10
9
11
10
import Data.Char (toLower )
@@ -74,7 +73,3 @@ deduceFortranVersion path
74
73
| otherwise = Fortran90 -- unrecognized, default to F90
75
74
where
76
75
isExtensionOf = flip isSuffixOf $ map toLower path
77
-
78
- -- | Alias for previous function name. TODO: deprecate eventually.
79
- deduceVersion :: FilePath -> FortranVersion
80
- deduceVersion = deduceFortranVersion
Original file line number Diff line number Diff line change 1
1
# 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
+
2
16
## Release 0.8.0
3
17
### Declarator constructor refactor
4
18
*** Necessitates changes.***
You can’t perform that action at this time.
0 commit comments