sourcemap 0.1.1.0 → 0.1.2.0
raw patch · 3 files changed
+7/−4 lines, 3 filesdep +text
Dependencies added: text
Files
- sourcemap.cabal +3/−2
- src/SourceMap.hs +2/−1
- src/SourceMap/Types.hs +2/−1
sourcemap.cabal view
@@ -1,5 +1,5 @@ name: sourcemap-version: 0.1.1.0+version: 0.1.2.0 synopsis: Implementation of source maps as proposed by Google and Mozilla. description: Implementation of source maps, revision 3, proposed by Google and Mozilla here <https://wiki.mozilla.org/DevTools/Features/SourceMap> and here@@ -25,4 +25,5 @@ unordered-containers, attoparsec, process,- utf8-string+ utf8-string,+ text
src/SourceMap.hs view
@@ -21,6 +21,7 @@ import Data.Maybe import Data.Ord import Data.STRef+import Data.Text (Text) -- | Generate the JSON from a source mapping. generate :: SourceMapping -> Value@@ -36,7 +37,7 @@ symbols f = sort (nub (mapMaybe f smMappings)) -- | Encode the mappings to the source map format.-encodeMappings :: [FilePath] -> [String] -> [Mapping] -> ByteString+encodeMappings :: [FilePath] -> [Text] -> [Mapping] -> ByteString encodeMappings sources names = go . sortBy (comparing mapGenerated) where go mappings = runST $ do -- State.
src/SourceMap/Types.hs view
@@ -6,6 +6,7 @@ import Data.Int import Data.Monoid+import Data.Text import Data.Function -- | The source mapping.@@ -20,7 +21,7 @@ { mapGenerated :: Pos , mapOriginal :: Maybe Pos , mapSourceFile :: Maybe FilePath- , mapName :: Maybe String+ , mapName :: Maybe Text } deriving Show -- | A source position.