dhscanner-ast 1.1.3 → 1.1.4
raw patch · 2 files changed
+18/−9 lines, 2 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Ast: [stmtImportFromSource] :: StmtImportContent -> Maybe String
+ Ast: ImportAlias :: String -> ImportAlias
+ Ast: ImportSpecific :: String -> ImportSpecific
+ Ast: [stmtImportSpecific] :: StmtImportContent -> Maybe ImportSpecific
+ Ast: instance Data.Aeson.Types.FromJSON.FromJSON Ast.ImportAlias
+ Ast: instance Data.Aeson.Types.FromJSON.FromJSON Ast.ImportSpecific
+ Ast: instance Data.Aeson.Types.ToJSON.ToJSON Ast.ImportAlias
+ Ast: instance Data.Aeson.Types.ToJSON.ToJSON Ast.ImportSpecific
+ Ast: instance GHC.Classes.Eq Ast.ImportAlias
+ Ast: instance GHC.Classes.Eq Ast.ImportSpecific
+ Ast: instance GHC.Classes.Ord Ast.ImportAlias
+ Ast: instance GHC.Classes.Ord Ast.ImportSpecific
+ Ast: instance GHC.Generics.Generic Ast.ImportAlias
+ Ast: instance GHC.Generics.Generic Ast.ImportSpecific
+ Ast: instance GHC.Show.Show Ast.ImportAlias
+ Ast: instance GHC.Show.Show Ast.ImportSpecific
+ Ast: newtype ImportAlias
+ Ast: newtype ImportSpecific
- Ast: StmtImportContent :: ImportSource -> Maybe String -> Maybe String -> Location -> StmtImportContent
+ Ast: StmtImportContent :: ImportSource -> Maybe ImportSpecific -> Maybe ImportAlias -> Location -> StmtImportContent
- Ast: [stmtImportAlias] :: StmtImportContent -> Maybe String
+ Ast: [stmtImportAlias] :: StmtImportContent -> Maybe ImportAlias
Files
- dhscanner-ast.cabal +1/−1
- src/Ast.hs +17/−8
dhscanner-ast.cabal view
@@ -22,7 +22,7 @@ and models both of them as plain sequential code blocks. Every file has exactly one ast that represents it. Non Haskell parogrammers note: The ast is /immutable/ (like everything else in Haskell ...) -version: 1.1.3 +version: 1.1.4 license: GPL-3.0-only license-file: LICENSE author: OrenGitHub
src/Ast.hs view
@@ -326,8 +326,8 @@ -- * Simple source import -- -- @ --- # stmtImportSource is "json" --- # stmtImportFromSource is Nothing +-- # stmtImportSource is (ImportSource (ImportThirdPartyContent "json")) <--- because json is /not/ an existing dir in the repo +-- # stmtImportSpecific is Nothing -- # stmtImportAlias is Nothing -- import json -- @ @@ -335,8 +335,8 @@ -- * Specifying a specific name from source -- -- @ --- # stmtImportSource is "urllib.parse" --- # stmtImportFromSource is Just "urljoin" +-- # stmtImportSource is (ImportSource (ImportThirdPartyContent "urllib.parse")) <--- because urllib/parse is /not/ an existing dir in the repo +-- # stmtImportSpecific is Just (ImportSpecific "urljoin") -- # stmtImportAlias is Nothing -- from urllib.parse import urljoin -- @ @@ -344,9 +344,9 @@ -- * Specifying an alias for a source import -- -- @ --- # stmtImportSource is "networkx" +-- # stmtImportSource is (ImportSource (ImportThirdPartyContent "networkx")) <--- because networkx is /not/ an existing dir in the repo -- # stmtImportFromSource is Nothing --- # stmtImportAlias is Just "nx" +-- # stmtImportAlias is Just (ImportAlias "nx") -- import networkx as nx -- @ -- @@ -354,8 +354,8 @@ = StmtImportContent { stmtImportSource :: ImportSource, - stmtImportFromSource :: Maybe String, - stmtImportAlias :: Maybe String, + stmtImportSpecific :: Maybe ImportSpecific, + stmtImportAlias :: Maybe ImportAlias, stmtImportLocation :: Location } deriving ( Show, Eq, Ord, Generic, ToJSON, FromJSON ) @@ -368,7 +368,16 @@ -- | Filename or directory newtype ImportLocalContent = ImportLocalContent FilePath deriving ( Show, Eq, Ord, Generic, ToJSON, FromJSON ) +-- | +-- Names that do not exist as directories in the repo +-- are classified by default as being "third party" newtype ImportThirdPartyContent = ImportThirdPartyContent String deriving ( Show, Eq, Ord, Generic, ToJSON, FromJSON ) + +-- | See `StmtImportContent` +newtype ImportSpecific = ImportSpecific String deriving ( Show, Eq, Ord, Generic, ToJSON, FromJSON ) + +-- | See `StmtImportContent` +newtype ImportAlias = ImportAlias String deriving ( Show, Eq, Ord, Generic, ToJSON, FromJSON ) data StmtContinueContent = StmtContinueContent