packages feed

fortran-src 0.16.7 → 0.16.8

raw patch · 6 files changed

+44/−20 lines, 6 filesdep ~basedep ~singletonsdep ~singletons-basePVP ok

version bump matches the API change (PVP)

Dependency ranges changed: base, singletons, singletons-base, singletons-th

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -1,3 +1,7 @@+### 0.16.8+  * Package build support up to GHC 9.12+  * Fixed pretty printing of array semantic types+ ### 0.16.7   * Added mention of Fortran 2003 version support in the help message   * Improved parsing of `allocate` statements
README.md view
@@ -3,7 +3,12 @@ [![DOI](https://joss.theoj.org/papers/10.21105/joss.07571/status.svg)](https://doi.org/10.21105/joss.07571)  -fortran-src is an open-source Haskell library and command-line application for the lexing, parsing, and static analysis of Fortran source code. It provides an interface to build other tools, e.g., for static analysis, automated refactoring, verification, and compilation. The following+fortran-src is an open-source Haskell library and command-line application for the lexing, parsing, and static analysis of Fortran source code. It provides an interface to build other tools, e.g., for static analysis, automated refactoring, verification, and compilation.++> To cite this work, or for a high-level overview, please take a look at our paper: [Contrastin et al., (2025). fortran-src: Fortran static analysis infrastructure. Journal of Open Source Software, 10(106), 7571, https://doi.org/10.21105/joss.07571](https://joss.theoj.org/papers/10.21105/joss.07571)+++The following Fortran standards are covered:    * FORTRAN 66 (ANSI X3.9-1966)@@ -96,7 +101,7 @@ Haskell library dependencies are listed in `package.yaml`. fortran-src supports building with Stack or Cabal. -fortran-src supports **GHC 9.0 through GHC 9.4**. We regularly test at least the+fortran-src supports **GHC 9.0 through GHC 9.12** (as of Aug 2025). We regularly test at least the minimum and maximum supported GHCs. Releases prior to/newer than those may have issues. We welcome fixes that would let us support a wider range of compilers. 
app/Main.hs view
@@ -51,7 +51,7 @@ programName = "fortran-src"  showVersion :: String-showVersion = "0.16.7"+showVersion = "0.16.8"  main :: IO () main = do
fortran-src.cabal view
@@ -1,11 +1,11 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.38.0.+-- This file has been generated from package.yaml by hpack version 0.38.1. -- -- see: https://github.com/sol/hpack  name:           fortran-src-version:        0.16.7+version:        0.16.8 synopsis:       Parsers and analyses for Fortran standards 66, 77, 90, 95 and 2003 (partial). description:    Provides lexing, parsing, and basic analyses of Fortran code covering standards: FORTRAN 66, FORTRAN 77, Fortran 90, Fortran 95, Fortran 2003 (partial) and some legacy extensions. Includes data flow and basic block analysis, a renamer, and type analysis. For example usage, see the @<https://hackage.haskell.org/package/camfort CamFort>@ project, which uses fortran-src as its front end. category:       Language@@ -20,7 +20,7 @@ license-file:   LICENSE build-type:     Simple tested-with:-    GHC >= 9.0+    GHC == 9.0, GHC == 9.2, GHC == 9.4, GHC == 9.6, GHC == 9.8, GHC == 9.10, GHC == 9.12 extra-source-files:     README.md     CHANGELOG.md@@ -194,7 +194,7 @@   build-depends:       GenericPretty >=1.2.2 && <2     , array ==0.5.*-    , base >=4.6 && <5+    , base >=4.6 && <4.22     , binary >=0.8.3.0 && <0.11     , bytestring >=0.10 && <0.13     , containers >=0.5 && <0.7@@ -206,9 +206,9 @@     , mtl >=2.2 && <3     , pretty >=1.1 && <2     , process >=1.2.0.0-    , singletons ==3.0.*-    , singletons-base >=3.0 && <3.4-    , singletons-th >=3.0 && <3.4+    , singletons >=3.0 && <3.6+    , singletons-base >=3.0 && <3.6+    , singletons-th >=3.0 && <3.6     , temporary >=1.2 && <1.4     , text >=1.2 && <2.2     , uniplate >=1.6 && <2@@ -257,7 +257,7 @@   build-depends:       GenericPretty >=1.2.2 && <2     , array ==0.5.*-    , base >=4.6 && <5+    , base >=4.6 && <4.22     , binary >=0.8.3.0 && <0.11     , bytestring >=0.10 && <0.13     , containers >=0.5 && <0.7@@ -270,9 +270,9 @@     , mtl >=2.2 && <3     , pretty >=1.1 && <2     , process >=1.2.0.0-    , singletons ==3.0.*-    , singletons-base >=3.0 && <3.4-    , singletons-th >=3.0 && <3.4+    , singletons >=3.0 && <3.6+    , singletons-base >=3.0 && <3.6+    , singletons-th >=3.0 && <3.6     , temporary >=1.2 && <1.4     , text >=1.2 && <2.2     , uniplate >=1.6 && <2@@ -355,7 +355,7 @@       GenericPretty >=1.2.2 && <2     , QuickCheck >=2.10 && <2.15     , array ==0.5.*-    , base >=4.6 && <5+    , base >=4.6 && <4.22     , binary >=0.8.3.0 && <0.11     , bytestring >=0.10 && <0.13     , containers >=0.5 && <0.7@@ -369,9 +369,9 @@     , mtl >=2.2 && <3     , pretty >=1.1 && <2     , process >=1.2.0.0-    , singletons ==3.0.*-    , singletons-base >=3.0 && <3.4-    , singletons-th >=3.0 && <3.4+    , singletons >=3.0 && <3.6+    , singletons-base >=3.0 && <3.6+    , singletons-th >=3.0 && <3.6     , temporary >=1.2 && <1.4     , text >=1.2 && <2.2     , uniplate >=1.6 && <2
src/Language/Fortran/Analysis/SemanticTypes.hs view
@@ -66,7 +66,7 @@       TLogical k -> "logical"<>pd k       TByte    k -> "byte"<>pd k       TCharacter _ _ -> "character(TODO)"-      TArray st dims -> pprint' v st <> pprint' v dims+      TArray st dims -> pprint' v st <> pdims v dims       TCustom str -> pprint' v (TypeCustom str)     | otherwise = \case       TInteger k -> "integer"<>ad k@@ -75,11 +75,13 @@       TLogical k -> "logical"<>ad k       TByte    k -> "byte"<>ad k       TCharacter _ _ -> "character*TODO"-      TArray st dims -> pprint' v st <> pprint' v dims+      TArray st dims -> pprint' v st <> pdims v dims       TCustom str -> pprint' v (TypeCustom str)     where        pd = Pretty.parens . doc        ad k = doc '*' <> doc k+       pdims v dims = maybe Pretty.empty (pprint' v) (dimsTraverse dims)+  -- | Convert 'Dimensions' data type to its previous type synonym --   @(Maybe [(Int, Int)])@.
test/Language/Fortran/Analysis/SemanticTypesSpec.hs view
@@ -1,3 +1,6 @@+{-# LANGUAGE OverloadedLists #-}+{-# LANGUAGE OverloadedStrings #-}+ module Language.Fortran.Analysis.SemanticTypesSpec where  import Test.Hspec@@ -7,6 +10,10 @@ import Language.Fortran.AST import Language.Fortran.Version +import Language.Fortran.PrettyPrint+import Text.PrettyPrint hiding ((<>))+import Text.PrettyPrint.GenericPretty+ spec :: Spec spec = do   describe "Semantic types" $ do@@ -29,3 +36,9 @@       let semtype  = TCharacter CharLenStar 1           typespec = TypeSpec () u TypeCharacter (Just (Selector () u (Just (ExpValue () u ValStar)) Nothing))        in recoverSemTypeTypeSpec () u Fortran90 semtype `shouldBe` typespec++    it "prints semantic type with dimensions" $ do+      let dims = DimsExplicitShape ( [ Dim (Just 1) (Just 3), Dim (Just 1) (Just 4) ] )+      let semtype  = TArray (TReal 8) dims+      pprint Fortran90 semtype Nothing `shouldBe` "real(8)(1:3, 1:4)"+