Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ghc-pretty-simple for openSUSE:Factory checked in at 2023-04-04 21:22:31 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-pretty-simple (Old) and /work/SRC/openSUSE:Factory/.ghc-pretty-simple.new.19717 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-pretty-simple" Tue Apr 4 21:22:31 2023 rev:5 rq:1076003 version:4.1.2.0 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-pretty-simple/ghc-pretty-simple.changes 2020-12-22 11:44:38.965775067 +0100 +++ /work/SRC/openSUSE:Factory/.ghc-pretty-simple.new.19717/ghc-pretty-simple.changes 2023-04-04 21:22:41.925971101 +0200 @@ -1,0 +2,48 @@ +Thu Mar 30 17:07:57 UTC 2023 - Peter Simons <psim...@suse.com> + +- Updated spec file to conform with ghc-rpm-macros-2.5.2. + +------------------------------------------------------------------- +Sat Oct 15 22:17:49 UTC 2022 - Peter Simons <psim...@suse.com> + +- Update pretty-simple to version 4.1.2.0. + ## 4.1.2.0 + + * Fix a problem with the `pHPrint` function incorrectly + outputting a trailing newline to stdout, instead of the + handle you pass it. + [#118](https://github.com/cdepillabout/pretty-simple/pull/118) + * Add a [web app](https://cdepillabout.github.io/pretty-simple/) where you + can play around with `pretty-simple` in your browser. + [#116](https://github.com/cdepillabout/pretty-simple/pull/116). + This took a lot of hard work by [@georgefst](https://github.com/georgefst)! + + ## 4.1.1.0 + + * Make the pretty-printed output with `outputOptionsCompact` enabled a little + more compact. + [#110](https://github.com/cdepillabout/pretty-simple/pull/110). + Thanks [@juhp](https://github.com/juhp)! + * Add a `--compact` / `-C` flag to the `pretty-simple` executable that enables + `outputOptionsCompact`. + [#111](https://github.com/cdepillabout/pretty-simple/pull/111). + Thanks again @juhp! + * Add `pTraceWith` and `pTraceShowWith` to `Debug.Pretty.Simple`. + [#104](https://github.com/cdepillabout/pretty-simple/pull/104). + Thanks [@LeviButcher](https://github.com/LeviButcher)! + + ## 4.1.0.0 + + * Fix a regression which arose in 4.0, whereby excess spaces would be inserted for unusual strings like dates and IP addresses. + [#105](https://github.com/cdepillabout/pretty-simple/pull/105) + * Attach warnings to debugging functions, so that they're easy to find and remove. + [#103](https://github.com/cdepillabout/pretty-simple/pull/103) + * Some minor improvements to the CLI tool: + * Add a `--version`/`-v` flag. + [#83](https://github.com/cdepillabout/pretty-simple/pull/83) + * Add a trailing newline. + [#87](https://github.com/cdepillabout/pretty-simple/pull/87) + * Install by default, without requiring a flag. + [#94](https://github.com/cdepillabout/pretty-simple/pull/94) + +------------------------------------------------------------------- Old: ---- pretty-simple-4.0.0.0.tar.gz New: ---- pretty-simple-4.1.2.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-pretty-simple.spec ++++++ --- /var/tmp/diff_new_pack.KeH6mx/_old 2023-04-04 21:22:42.433973978 +0200 +++ /var/tmp/diff_new_pack.KeH6mx/_new 2023-04-04 21:22:42.453974092 +0200 @@ -1,7 +1,7 @@ # # spec file for package ghc-pretty-simple # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,29 +17,47 @@ %global pkg_name pretty-simple +%global pkgver %{pkg_name}-%{version} %bcond_with tests Name: ghc-%{pkg_name} -Version: 4.0.0.0 +Version: 4.1.2.0 Release: 0 Summary: Pretty printer for data types with a 'Show' instance License: BSD-3-Clause URL: https://hackage.haskell.org/package/%{pkg_name} Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz +BuildRequires: chrpath BuildRequires: ghc-Cabal-devel +BuildRequires: ghc-Cabal-prof +BuildRequires: ghc-base-devel +BuildRequires: ghc-base-prof BuildRequires: ghc-cabal-doctest-devel +BuildRequires: ghc-cabal-doctest-prof BuildRequires: ghc-containers-devel +BuildRequires: ghc-containers-prof BuildRequires: ghc-mtl-devel +BuildRequires: ghc-mtl-prof +BuildRequires: ghc-optparse-applicative-devel +BuildRequires: ghc-optparse-applicative-prof BuildRequires: ghc-prettyprinter-ansi-terminal-devel +BuildRequires: ghc-prettyprinter-ansi-terminal-prof BuildRequires: ghc-prettyprinter-devel +BuildRequires: ghc-prettyprinter-prof BuildRequires: ghc-rpm-macros BuildRequires: ghc-text-devel +BuildRequires: ghc-text-prof BuildRequires: ghc-transformers-devel +BuildRequires: ghc-transformers-prof ExcludeArch: %{ix86} %if %{with tests} BuildRequires: ghc-Glob-devel +BuildRequires: ghc-Glob-prof BuildRequires: ghc-QuickCheck-devel +BuildRequires: ghc-QuickCheck-prof BuildRequires: ghc-doctest-devel +BuildRequires: ghc-doctest-prof BuildRequires: ghc-template-haskell-devel +BuildRequires: ghc-template-haskell-prof %endif %description @@ -55,6 +73,22 @@ %description devel This package provides the Haskell %{pkg_name} library development files. +%package -n ghc-%{pkg_name}-doc +Summary: Haskell %{pkg_name} library documentation +Requires: ghc-filesystem +BuildArch: noarch + +%description -n ghc-%{pkg_name}-doc +This package provides the Haskell %{pkg_name} library documentation. + +%package -n ghc-%{pkg_name}-prof +Summary: Haskell %{pkg_name} profiling library +Requires: ghc-%{pkg_name}-devel = %{version}-%{release} +Supplements: (ghc-%{pkg_name}-devel and ghc-prof) + +%description -n ghc-%{pkg_name}-prof +This package provides the Haskell %{pkg_name} profiling library. + %prep %autosetup -n %{pkg_name}-%{version} @@ -63,6 +97,7 @@ %install %ghc_lib_install +%ghc_fix_rpath %{pkg_name}-%{version} %check %cabal_test @@ -75,8 +110,14 @@ %files -f %{name}.files %license LICENSE +%{_bindir}/%{pkg_name} %files devel -f %{name}-devel.files %doc CHANGELOG.md README.md +%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files +%license LICENSE + +%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files + %changelog ++++++ pretty-simple-4.0.0.0.tar.gz -> pretty-simple-4.1.2.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pretty-simple-4.0.0.0/CHANGELOG.md new/pretty-simple-4.1.2.0/CHANGELOG.md --- old/pretty-simple-4.0.0.0/CHANGELOG.md 2001-09-09 03:46:40.000000000 +0200 +++ new/pretty-simple-4.1.2.0/CHANGELOG.md 2022-10-15 23:47:14.000000000 +0200 @@ -1,4 +1,43 @@ +## 4.1.2.0 + +* Fix a problem with the `pHPrint` function incorrectly + outputting a trailing newline to stdout, instead of the + handle you pass it. + [#118](https://github.com/cdepillabout/pretty-simple/pull/118) +* Add a [web app](https://cdepillabout.github.io/pretty-simple/) where you + can play around with `pretty-simple` in your browser. + [#116](https://github.com/cdepillabout/pretty-simple/pull/116). + This took a lot of hard work by [@georgefst](https://github.com/georgefst)! + +## 4.1.1.0 + +* Make the pretty-printed output with `outputOptionsCompact` enabled a little + more compact. + [#110](https://github.com/cdepillabout/pretty-simple/pull/110). + Thanks [@juhp](https://github.com/juhp)! +* Add a `--compact` / `-C` flag to the `pretty-simple` executable that enables + `outputOptionsCompact`. + [#111](https://github.com/cdepillabout/pretty-simple/pull/111). + Thanks again @juhp! +* Add `pTraceWith` and `pTraceShowWith` to `Debug.Pretty.Simple`. + [#104](https://github.com/cdepillabout/pretty-simple/pull/104). + Thanks [@LeviButcher](https://github.com/LeviButcher)! + +## 4.1.0.0 + +* Fix a regression which arose in 4.0, whereby excess spaces would be inserted for unusual strings like dates and IP addresses. + [#105](https://github.com/cdepillabout/pretty-simple/pull/105) +* Attach warnings to debugging functions, so that they're easy to find and remove. + [#103](https://github.com/cdepillabout/pretty-simple/pull/103) +* Some minor improvements to the CLI tool: + * Add a `--version`/`-v` flag. + [#83](https://github.com/cdepillabout/pretty-simple/pull/83) + * Add a trailing newline. + [#87](https://github.com/cdepillabout/pretty-simple/pull/87) + * Install by default, without requiring a flag. + [#94](https://github.com/cdepillabout/pretty-simple/pull/94) + ## 4.0.0.0 * Expand `OutputOptions`: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pretty-simple-4.0.0.0/README.md new/pretty-simple-4.1.2.0/README.md --- old/pretty-simple-4.0.0.0/README.md 2001-09-09 03:46:40.000000000 +0200 +++ new/pretty-simple-4.1.2.0/README.md 2022-10-15 23:42:05.000000000 +0200 @@ -37,19 +37,28 @@ `pretty-simple` can be used to print `bar` in an easy-to-read format: - + + +There's a [web app](https://cdepillabout.github.io/pretty-simple) compiled with +GHCJS where you can play around with `pretty-simple` running in your browser. ## Usage `pretty-simple` can be easily used from `ghci` when debugging. When using `stack` to run `ghci`, just append the `--package` flag to -the command line to load `pretty-simple`. +the command line to load `pretty-simple`: ```sh $ stack ghci --package pretty-simple ``` +Or, with cabal: + +```sh +$ cabal repl --build-depends pretty-simple +``` + Once you get a prompt in `ghci`, you can use `import` to get `pretty-simple`'s [`pPrint`](https://hackage.haskell.org/package/pretty-simple/docs/Text-Pretty-Simple.html#v:pPrint) function in scope. @@ -81,7 +90,7 @@ - Easy to understand deeply nested data types. - Configurable - Indentation, compactness, colors and more are configurable with the - [`pPrintOpt`](https://hackage.haskell.org/package/pretty-simple/docs/Text-Pretty-Simple.html#v:pPrintOpt) + [`pPrintOpt`](https://hackage.haskell.org/package/pretty-simple-1.0.0.6/docs/Text-Pretty-Simple.html#v:pPrintOpt) function. - Fast - No problem pretty-printing data types thousands of lines long. @@ -106,11 +115,14 @@ The `pPrint` function can be used as the default output function in GHCi. -All you need to do is run GHCi like this: +All you need to do is run GHCi with a command like one of these: ```sh $ stack ghci --ghci-options "-interactive-print=Text.Pretty.Simple.pPrint" --package pretty-simple ``` +```sh +$ cabal repl --repl-options "-interactive-print=Text.Pretty.Simple.pPrint" --build-depends pretty-simple +``` Now, whenever you make GHCi evaluate an expression, GHCi will pretty-print the result using `pPrint`! See @@ -166,7 +178,7 @@ `pretty-simple` can be used to pretty-print the JSON-encoded `bar` in an easy-to-read format: - + (You can find the `lazyByteStringToString`, `putLazyByteStringLn`, and `putLazyTextLn` in the [`ExampleJSON.hs`](example/ExampleJSON.hs) @@ -177,17 +189,16 @@ `pretty-simple` includes a command line executable that can be used to pretty-print anything passed in on stdin. -It can be installed to `~/.local/bin/` with the following command. Note that you -must enable the `buildexe` flag, since it will not be built by default: +It can be installed to `~/.local/bin/` with the following command. ```sh -$ stack install pretty-simple-4.0.0.0 --flag pretty-simple:buildexe +$ stack install pretty-simple ``` When run on the command line, you can paste in the Haskell datatype you want to be formatted, then hit <kbd>Ctrl</kbd>-<kbd>D</kbd>: - + This is very useful if you accidentally print out a Haskell data type with `print` instead of `pPrint`. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pretty-simple-4.0.0.0/app/Main.hs new/pretty-simple-4.1.2.0/app/Main.hs --- old/pretty-simple-4.0.0.0/app/Main.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/pretty-simple-4.1.2.0/app/Main.hs 2022-09-25 22:43:34.000000000 +0200 @@ -23,25 +23,32 @@ -- ] -- @ +import Data.Monoid ((<>)) import Data.Text (unpack) import qualified Data.Text.IO as T import qualified Data.Text.Lazy.IO as LT -import Options.Applicative - ( Parser, ReadM, execParser, fullDesc, help, helper, info, long - , option, progDesc, readerError, short, showDefaultWith, str, value, (<**>)) -import Data.Monoid ((<>)) -import Text.Pretty.Simple +import Data.Version (showVersion) +import Options.Applicative + ( Parser, ReadM, execParser, fullDesc, help, helper, info, infoOption + , long, option, progDesc, readerError, short, showDefaultWith, str + , switch, value) +import Paths_pretty_simple (version) +import Text.Pretty.Simple ( pStringOpt, OutputOptions , defaultOutputOptionsDarkBg , defaultOutputOptionsLightBg , defaultOutputOptionsNoColor + , outputOptionsCompact ) data Color = DarkBg | LightBg | NoColor -newtype Args = Args { color :: Color } +data Args = Args + { color :: Color + , compact :: Bool + } colorReader :: ReadM Color colorReader = do @@ -58,24 +65,41 @@ ( long "color" <> short 'c' <> help "Select printing color. Available options: dark-bg (default), light-bg, no-color." - <> showDefaultWith (\_ -> "dark-bg") + <> showDefaultWith (const "dark-bg") <> value DarkBg ) + <*> switch + ( long "compact" + <> short 'C' + <> help "Compact output" + ) + +versionOption :: Parser (a -> a) +versionOption = + infoOption + (showVersion version) + ( long "version" + <> short 'V' + <> help "Show version" + ) main :: IO () main = do args' <- execParser opts input <- T.getContents - let printOpt = getPrintOpt $ color args' - output = pStringOpt printOpt $ unpack input - LT.putStr output + let output = pStringOpt (getPrintOpt args') $ unpack input + LT.putStrLn output where - opts = info (args <**> helper) + opts = info (helper <*> versionOption <*> args) ( fullDesc <> progDesc "Format Haskell data types with indentation and highlighting" ) - getPrintOpt :: Color -> OutputOptions - getPrintOpt DarkBg = defaultOutputOptionsDarkBg - getPrintOpt LightBg = defaultOutputOptionsLightBg - getPrintOpt NoColor = defaultOutputOptionsNoColor + getPrintOpt :: Args -> OutputOptions + getPrintOpt as = + (getColorOpt (color as)) {outputOptionsCompact = compact as} + + getColorOpt :: Color -> OutputOptions + getColorOpt DarkBg = defaultOutputOptionsDarkBg + getColorOpt LightBg = defaultOutputOptionsLightBg + getColorOpt NoColor = defaultOutputOptionsNoColor diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pretty-simple-4.0.0.0/pretty-simple.cabal new/pretty-simple-4.1.2.0/pretty-simple.cabal --- old/pretty-simple-4.0.0.0/pretty-simple.cabal 2001-09-09 03:46:40.000000000 +0200 +++ new/pretty-simple-4.1.2.0/pretty-simple.cabal 2022-10-15 23:38:22.000000000 +0200 @@ -1,5 +1,5 @@ name: pretty-simple -version: 4.0.0.0 +version: 4.1.2.0 synopsis: pretty printer for data types with a 'Show' instance. description: Please see <https://github.com/cdepillabout/pretty-simple#readme README.md>. homepage: https://github.com/cdepillabout/pretty-simple @@ -22,7 +22,7 @@ flag buildexe description: Build an small command line program that pretty-print anything from stdin. - default: False + default: True flag buildexample description: Build a small example program showing how to use the pPrint function @@ -50,6 +50,7 @@ executable pretty-simple main-is: Main.hs + other-modules: Paths_pretty_simple hs-source-dirs: app build-depends: base , pretty-simple diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pretty-simple-4.0.0.0/src/Debug/Pretty/Simple.hs new/pretty-simple-4.1.2.0/src/Debug/Pretty/Simple.hs --- old/pretty-simple-4.0.0.0/src/Debug/Pretty/Simple.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/pretty-simple-4.1.2.0/src/Debug/Pretty/Simple.hs 2022-09-25 22:43:34.000000000 +0200 @@ -30,6 +30,8 @@ , pTraceEventIO , pTraceMarker , pTraceMarkerIO + , pTraceWith + , pTraceShowWith -- * Trace forcing color , pTraceForceColor , pTraceIdForceColor @@ -95,6 +97,7 @@ @since 2.0.1.0 -} +{-# WARNING pTraceIO "'pTraceIO' remains in code" #-} pTraceIO :: String -> IO () pTraceIO = pTraceOptIO CheckColorTty defaultOutputOptionsDarkBg @@ -113,6 +116,7 @@ @since 2.0.1.0 -} +{-# WARNING pTrace "'pTrace' remains in code" #-} pTrace :: String -> a -> a pTrace = pTraceOpt CheckColorTty defaultOutputOptionsDarkBg @@ -121,6 +125,7 @@ @since 2.0.1.0 -} +{-# WARNING pTraceId "'pTraceId' remains in code" #-} pTraceId :: String -> String pTraceId = pTraceIdOpt CheckColorTty defaultOutputOptionsDarkBg @@ -139,6 +144,7 @@ @since 2.0.1.0 -} +{-# WARNING pTraceShow "'pTraceShow' remains in code" #-} pTraceShow :: (Show a) => a -> b -> b pTraceShow = pTraceShowOpt CheckColorTty defaultOutputOptionsDarkBg @@ -147,6 +153,7 @@ @since 2.0.1.0 -} +{-# WARNING pTraceShowId "'pTraceShowId' remains in code" #-} pTraceShowId :: (Show a) => a -> a pTraceShowId = pTraceShowIdOpt CheckColorTty defaultOutputOptionsDarkBg {-| @@ -168,6 +175,7 @@ @since 2.0.1.0 -} +{-# WARNING pTraceM "'pTraceM' remains in code" #-} #if __GLASGOW_HASKELL__ < 800 pTraceM :: (Monad f) => String -> f () #else @@ -185,6 +193,7 @@ @since 2.0.1.0 -} +{-# WARNING pTraceShowM "'pTraceShowM' remains in code" #-} #if __GLASGOW_HASKELL__ < 800 pTraceShowM :: (Show a, Monad f) => a -> f () #else @@ -204,6 +213,7 @@ @since 2.0.1.0 -} +{-# WARNING pTraceStack "'pTraceStack' remains in code" #-} pTraceStack :: String -> a -> a pTraceStack = pTraceStackOpt CheckColorTty defaultOutputOptionsDarkBg @@ -221,6 +231,7 @@ @since 2.0.1.0 -} +{-# WARNING pTraceEvent "'pTraceEvent' remains in code" #-} pTraceEvent :: String -> a -> a pTraceEvent = pTraceEventOpt CheckColorTty defaultOutputOptionsDarkBg @@ -233,6 +244,7 @@ @since 2.0.1.0 -} +{-# WARNING pTraceEventIO "'pTraceEventIO' remains in code" #-} pTraceEventIO :: String -> IO () pTraceEventIO = pTraceEventOptIO CheckColorTty defaultOutputOptionsDarkBg @@ -249,6 +261,7 @@ -- that uses 'pTraceMarker'. -- -- @since 2.0.1.0 +{-# WARNING pTraceMarker "'pTraceMarker' remains in code" #-} pTraceMarker :: String -> a -> a pTraceMarker = pTraceMarkerOpt CheckColorTty defaultOutputOptionsDarkBg @@ -259,12 +272,30 @@ -- to other IO actions. -- -- @since 2.0.1.0 +{-# WARNING pTraceMarkerIO "'pTraceMarkerIO' remains in code" #-} pTraceMarkerIO :: String -> IO () pTraceMarkerIO = pTraceMarkerOptIO CheckColorTty defaultOutputOptionsDarkBg +-- | The 'pTraceWith' function pretty prints the result of +-- applying @f to @a and returns back @a +-- +-- @since ? +{-# WARNING pTraceWith "'pTraceWith' remains in code" #-} +pTraceWith :: (a -> String) -> a -> a +pTraceWith f a = pTrace (f a) a + +-- | The 'pTraceShowWith' function similar to 'pTraceWith' except that +-- @f can return any type that implements Show +-- +-- @since ? +{-# WARNING pTraceShowWith "'pTraceShowWith' remains in code" #-} +pTraceShowWith :: Show b => (a -> b) -> a -> a +pTraceShowWith f = (show . f) >>= pTraceShow + ------------------------------------------ -- Helpers ------------------------------------------ +{-# WARNING pStringTTYOptIO "'pStringTTYOptIO' remains in code" #-} pStringTTYOptIO :: CheckColorTty -> OutputOptions -> String -> IO Text pStringTTYOptIO checkColorTty outputOptions v = do realOutputOpts <- @@ -273,14 +304,17 @@ NoCheckColorTty -> pure outputOptions pure $ pStringOpt realOutputOpts v +{-# WARNING pStringTTYOpt "'pStringTTYOpt' remains in code" #-} pStringTTYOpt :: CheckColorTty -> OutputOptions -> String -> Text pStringTTYOpt checkColorTty outputOptions = unsafePerformIO . pStringTTYOptIO checkColorTty outputOptions +{-# WARNING pShowTTYOptIO "'pShowTTYOptIO' remains in code" #-} pShowTTYOptIO :: Show a => CheckColorTty -> OutputOptions -> a -> IO Text pShowTTYOptIO checkColorTty outputOptions = pStringTTYOptIO checkColorTty outputOptions . show +{-# WARNING pShowTTYOpt "'pShowTTYOpt' remains in code" #-} pShowTTYOpt :: Show a => CheckColorTty -> OutputOptions -> a -> Text pShowTTYOpt checkColorTty outputOptions = unsafePerformIO . pShowTTYOptIO checkColorTty outputOptions @@ -289,22 +323,27 @@ -- Traces forcing color ------------------------------------------ -- | Similar to 'pTrace', but forcing color. +{-# WARNING pTraceForceColor "'pTraceForceColor' remains in code" #-} pTraceForceColor :: String -> a -> a pTraceForceColor = pTraceOpt NoCheckColorTty defaultOutputOptionsDarkBg -- | Similar to 'pTraceId', but forcing color. +{-# WARNING pTraceIdForceColor "'pTraceIdForceColor' remains in code" #-} pTraceIdForceColor :: String -> String pTraceIdForceColor = pTraceIdOpt NoCheckColorTty defaultOutputOptionsDarkBg -- | Similar to 'pTraceShow', but forcing color. +{-# WARNING pTraceShowForceColor "'pTraceShowForceColor' remains in code" #-} pTraceShowForceColor :: (Show a) => a -> b -> b pTraceShowForceColor = pTraceShowOpt NoCheckColorTty defaultOutputOptionsDarkBg -- | Similar to 'pTraceShowId', but forcing color. +{-# WARNING pTraceShowIdForceColor "'pTraceShowIdForceColor' remains in code" #-} pTraceShowIdForceColor :: (Show a) => a -> a pTraceShowIdForceColor = pTraceShowIdOpt NoCheckColorTty defaultOutputOptionsDarkBg -- | Similar to 'pTraceM', but forcing color. +{-# WARNING pTraceMForceColor "'pTraceMForceColor' remains in code" #-} #if __GLASGOW_HASKELL__ < 800 pTraceMForceColor :: (Monad f) => String -> f () #else @@ -312,6 +351,7 @@ #endif pTraceMForceColor = pTraceOptM NoCheckColorTty defaultOutputOptionsDarkBg -- | Similar to 'pTraceShowM', but forcing color. +{-# WARNING pTraceShowMForceColor "'pTraceShowMForceColor' remains in code" #-} #if __GLASGOW_HASKELL__ < 800 pTraceShowMForceColor :: (Show a, Monad f) => a -> f () #else @@ -321,31 +361,37 @@ pTraceShowOptM NoCheckColorTty defaultOutputOptionsDarkBg -- | Similar to 'pTraceStack', but forcing color. +{-# WARNING pTraceStackForceColor "'pTraceStackForceColor' remains in code" #-} pTraceStackForceColor :: String -> a -> a pTraceStackForceColor = pTraceStackOpt NoCheckColorTty defaultOutputOptionsDarkBg -- | Similar to 'pTraceEvent', but forcing color. +{-# WARNING pTraceEventForceColor "'pTraceEventForceColor' remains in code" #-} pTraceEventForceColor :: String -> a -> a pTraceEventForceColor = pTraceEventOpt NoCheckColorTty defaultOutputOptionsDarkBg -- | Similar to 'pTraceEventIO', but forcing color. +{-# WARNING pTraceEventIOForceColor "'pTraceEventIOForceColor' remains in code" #-} pTraceEventIOForceColor :: String -> IO () pTraceEventIOForceColor = pTraceEventOptIO NoCheckColorTty defaultOutputOptionsDarkBg -- | Similar to 'pTraceMarker', but forcing color. +{-# WARNING pTraceMarkerForceColor "'pTraceMarkerForceColor' remains in code" #-} pTraceMarkerForceColor :: String -> a -> a pTraceMarkerForceColor = pTraceMarkerOpt NoCheckColorTty defaultOutputOptionsDarkBg -- | Similar to 'pTraceMarkerIO', but forcing color. +{-# WARNING pTraceMarkerIOForceColor "'pTraceMarkerIOForceColor' remains in code" #-} pTraceMarkerIOForceColor :: String -> IO () pTraceMarkerIOForceColor = pTraceMarkerOptIO NoCheckColorTty defaultOutputOptionsDarkBg -- | Similar to 'pTraceIO', but forcing color. +{-# WARNING pTraceIOForceColor "'pTraceIOForceColor' remains in code" #-} pTraceIOForceColor :: String -> IO () pTraceIOForceColor = pTraceOptIO NoCheckColorTty defaultOutputOptionsDarkBg @@ -359,6 +405,7 @@ -- () -- -- @since 2.0.2.0 +{-# WARNING pTraceNoColor "'pTraceNoColor' remains in code" #-} pTraceNoColor :: String -> a -> a pTraceNoColor = pTraceOpt NoCheckColorTty defaultOutputOptionsNoColor @@ -372,6 +419,7 @@ -- () -- -- @since 2.0.2.0 +{-# WARNING pTraceIdNoColor "'pTraceIdNoColor' remains in code" #-} pTraceIdNoColor :: String -> String pTraceIdNoColor = pTraceIdOpt NoCheckColorTty defaultOutputOptionsNoColor @@ -388,6 +436,7 @@ -- () -- -- @since 2.0.2.0 +{-# WARNING pTraceShowNoColor "'pTraceShowNoColor' remains in code" #-} pTraceShowNoColor :: (Show a) => a -> b -> b pTraceShowNoColor = pTraceShowOpt NoCheckColorTty defaultOutputOptionsNoColor @@ -404,6 +453,7 @@ -- () -- -- @since 2.0.2.0 +{-# WARNING pTraceShowIdNoColor "'pTraceShowIdNoColor' remains in code" #-} pTraceShowIdNoColor :: (Show a) => a -> a pTraceShowIdNoColor = pTraceShowIdOpt NoCheckColorTty defaultOutputOptionsNoColor @@ -413,6 +463,7 @@ -- wow -- -- @since 2.0.2.0 +{-# WARNING pTraceMNoColor "'pTraceMNoColor' remains in code" #-} #if __GLASGOW_HASKELL__ < 800 pTraceMNoColor :: (Monad f) => String -> f () #else @@ -428,6 +479,7 @@ -- ] -- -- @since 2.0.2.0 +{-# WARNING pTraceShowMNoColor "'pTraceShowMNoColor' remains in code" #-} #if __GLASGOW_HASKELL__ < 800 pTraceShowMNoColor :: (Show a, Monad f) => a -> f () #else @@ -442,18 +494,21 @@ -- () -- -- @since 2.0.2.0 +{-# WARNING pTraceStackNoColor "'pTraceStackNoColor' remains in code" #-} pTraceStackNoColor :: String -> a -> a pTraceStackNoColor = pTraceStackOpt NoCheckColorTty defaultOutputOptionsNoColor -- | Similar to 'pTraceEvent', but without color. -- -- @since 2.0.2.0 +{-# WARNING pTraceEventNoColor "'pTraceEventNoColor' remains in code" #-} pTraceEventNoColor :: String -> a -> a pTraceEventNoColor = pTraceEventOpt NoCheckColorTty defaultOutputOptionsNoColor -- | Similar to 'pTraceEventIO', but without color. -- -- @since 2.0.2.0 +{-# WARNING pTraceEventIONoColor "'pTraceEventIONoColor' remains in code" #-} pTraceEventIONoColor :: String -> IO () pTraceEventIONoColor = pTraceEventOptIO NoCheckColorTty defaultOutputOptionsNoColor @@ -461,6 +516,7 @@ -- | Similar to 'pTraceMarker', but without color. -- -- @since 2.0.2.0 +{-# WARNING pTraceMarkerNoColor "'pTraceMarkerNoColor' remains in code" #-} pTraceMarkerNoColor :: String -> a -> a pTraceMarkerNoColor = pTraceMarkerOpt NoCheckColorTty defaultOutputOptionsNoColor @@ -468,6 +524,7 @@ -- | Similar to 'pTraceMarkerIO', but without color. -- -- @since 2.0.2.0 +{-# WARNING pTraceMarkerIONoColor "'pTraceMarkerIONoColor' remains in code" #-} pTraceMarkerIONoColor :: String -> IO () pTraceMarkerIONoColor = pTraceMarkerOptIO NoCheckColorTty defaultOutputOptionsNoColor @@ -481,6 +538,7 @@ -- ) -- -- @since 2.0.2.0 +{-# WARNING pTraceIONoColor "'pTraceIONoColor' remains in code" #-} pTraceIONoColor :: String -> IO () pTraceIONoColor = pTraceOptIO NoCheckColorTty defaultOutputOptionsNoColor @@ -490,6 +548,7 @@ {-| Like 'pTrace' but takes OutputOptions. -} +{-# WARNING pTraceOpt "'pTraceOpt' remains in code" #-} pTraceOpt :: CheckColorTty -> OutputOptions -> String -> a -> a pTraceOpt checkColorTty outputOptions = trace . unpack . pStringTTYOpt checkColorTty outputOptions @@ -497,6 +556,7 @@ {-| Like 'pTraceId' but takes OutputOptions. -} +{-# WARNING pTraceIdOpt "'pTraceIdOpt' remains in code" #-} pTraceIdOpt :: CheckColorTty -> OutputOptions -> String -> String pTraceIdOpt checkColorTty outputOptions a = pTraceOpt checkColorTty outputOptions a a @@ -504,6 +564,7 @@ {-| Like 'pTraceShow' but takes OutputOptions. -} +{-# WARNING pTraceShowOpt "'pTraceShowOpt' remains in code" #-} pTraceShowOpt :: (Show a) => CheckColorTty -> OutputOptions -> a -> b -> b pTraceShowOpt checkColorTty outputOptions = trace . unpack . pShowTTYOpt checkColorTty outputOptions @@ -511,6 +572,7 @@ {-| Like 'pTraceShowId' but takes OutputOptions. -} +{-# WARNING pTraceShowIdOpt "'pTraceShowIdOpt' remains in code" #-} pTraceShowIdOpt :: (Show a) => CheckColorTty -> OutputOptions -> a -> a pTraceShowIdOpt checkColorTty outputOptions a = trace (unpack $ pShowTTYOpt checkColorTty outputOptions a) a @@ -518,12 +580,14 @@ {-| Like 'pTraceIO' but takes OutputOptions. -} +{-# WARNING pTraceOptIO "'pTraceOptIO' remains in code" #-} pTraceOptIO :: CheckColorTty -> OutputOptions -> String -> IO () pTraceOptIO checkColorTty outputOptions = traceIO . unpack <=< pStringTTYOptIO checkColorTty outputOptions {-| Like 'pTraceM' but takes OutputOptions. -} +{-# WARNING pTraceOptM "'pTraceOptM' remains in code" #-} #if __GLASGOW_HASKELL__ < 800 pTraceOptM :: (Monad f) => CheckColorTty -> OutputOptions -> String -> f () #else @@ -535,6 +599,7 @@ {-| Like 'pTraceShowM' but takes OutputOptions. -} +{-# WARNING pTraceShowOptM "'pTraceShowOptM' remains in code" #-} #if __GLASGOW_HASKELL__ < 800 pTraceShowOptM :: (Show a, Monad f) => CheckColorTty -> OutputOptions -> a -> f () @@ -548,6 +613,7 @@ {-| Like 'pTraceStack' but takes OutputOptions. -} +{-# WARNING pTraceStackOpt "'pTraceStackOpt' remains in code" #-} pTraceStackOpt :: CheckColorTty -> OutputOptions -> String -> a -> a pTraceStackOpt checkColorTty outputOptions = traceStack . unpack . pStringTTYOpt checkColorTty outputOptions @@ -555,6 +621,7 @@ {-| Like 'pTraceEvent' but takes OutputOptions. -} +{-# WARNING pTraceEventOpt "'pTraceEventOpt' remains in code" #-} pTraceEventOpt :: CheckColorTty -> OutputOptions -> String -> a -> a pTraceEventOpt checkColorTty outputOptions = traceEvent . unpack . pStringTTYOpt checkColorTty outputOptions @@ -562,6 +629,7 @@ {-| Like 'pTraceEventIO' but takes OutputOptions. -} +{-# WARNING pTraceEventOptIO "'pTraceEventOptIO' remains in code" #-} pTraceEventOptIO :: CheckColorTty -> OutputOptions -> String -> IO () pTraceEventOptIO checkColorTty outputOptions = traceEventIO . unpack <=< pStringTTYOptIO checkColorTty outputOptions @@ -569,6 +637,7 @@ {-| Like 'pTraceMarker' but takes OutputOptions. -} +{-# WARNING pTraceMarkerOpt "'pTraceMarkerOpt' remains in code" #-} pTraceMarkerOpt :: CheckColorTty -> OutputOptions -> String -> a -> a pTraceMarkerOpt checkColorTty outputOptions = traceMarker . unpack . pStringTTYOpt checkColorTty outputOptions @@ -576,6 +645,7 @@ {-| Like 'pTraceMarkerIO' but takes OutputOptions. -} +{-# WARNING pTraceMarkerOptIO "'pTraceMarkerOptIO' remains in code" #-} pTraceMarkerOptIO :: CheckColorTty -> OutputOptions -> String -> IO () pTraceMarkerOptIO checkColorTty outputOptions = traceMarkerIO . unpack <=< pStringTTYOptIO checkColorTty outputOptions diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pretty-simple-4.0.0.0/src/Text/Pretty/Simple/Internal/Color.hs new/pretty-simple-4.1.2.0/src/Text/Pretty/Simple/Internal/Color.hs --- old/pretty-simple-4.0.0.0/src/Text/Pretty/Simple/Internal/Color.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/pretty-simple-4.1.2.0/src/Text/Pretty/Simple/Internal/Color.hs 2022-09-25 22:43:34.000000000 +0200 @@ -7,7 +7,6 @@ {-# LANGUAGE RankNTypes #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE TemplateHaskell #-} {-| Module : Text.Pretty.Simple.Internal.Color diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pretty-simple-4.0.0.0/src/Text/Pretty/Simple/Internal/Expr.hs new/pretty-simple-4.1.2.0/src/Text/Pretty/Simple/Internal/Expr.hs --- old/pretty-simple-4.0.0.0/src/Text/Pretty/Simple/Internal/Expr.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/pretty-simple-4.1.2.0/src/Text/Pretty/Simple/Internal/Expr.hs 2022-09-25 22:43:34.000000000 +0200 @@ -4,7 +4,6 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE TemplateHaskell #-} {-| Module : Text.Pretty.Simple.Internal.Expr diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pretty-simple-4.0.0.0/src/Text/Pretty/Simple/Internal/ExprParser.hs new/pretty-simple-4.1.2.0/src/Text/Pretty/Simple/Internal/ExprParser.hs --- old/pretty-simple-4.0.0.0/src/Text/Pretty/Simple/Internal/ExprParser.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/pretty-simple-4.1.2.0/src/Text/Pretty/Simple/Internal/ExprParser.hs 2022-09-25 22:43:34.000000000 +0200 @@ -1,10 +1,7 @@ {-# LANGUAGE CPP #-} -{-# LANGUAGE DeriveDataTypeable #-} -{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE TemplateHaskell #-} {-| Module : Text.Pretty.Simple.Internal.ExprParser diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pretty-simple-4.0.0.0/src/Text/Pretty/Simple/Internal/Printer.hs new/pretty-simple-4.1.2.0/src/Text/Pretty/Simple/Internal/Printer.hs --- old/pretty-simple-4.0.0.0/src/Text/Pretty/Simple/Internal/Printer.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/pretty-simple-4.1.2.0/src/Text/Pretty/Simple/Internal/Printer.hs 2022-10-15 23:32:22.000000000 +0200 @@ -32,14 +32,14 @@ import Control.Monad.IO.Class (MonadIO, liftIO) import Control.Monad (join) import Control.Monad.State (MonadState, evalState, modify, gets) -import Data.Char (isPrint, isSpace, ord) -import Data.List (dropWhileEnd) +import Data.Char (isPrint, ord) import Data.List.NonEmpty (NonEmpty, nonEmpty) import Data.Maybe (fromMaybe) import Prettyprinter - (indent, line', PageWidth(AvailablePerLine), layoutPageWidth, nest, hsep, + (indent, line', PageWidth(AvailablePerLine), layoutPageWidth, nest, concatWith, space, Doc, SimpleDocStream, annotate, defaultLayoutOptions, - enclose, hcat, layoutSmart, line, unAnnotateS, pretty, group) + enclose, hcat, layoutSmart, line, unAnnotateS, pretty, group, + removeTrailingWhitespace) import Data.Typeable (Typeable) import GHC.Generics (Generic) import Numeric (showHex) @@ -195,13 +195,15 @@ -- suitable for passing to any /prettyprinter/ backend. -- Used by 'Simple.pString' etc. layoutString :: OutputOptions -> String -> SimpleDocStream Style -layoutString opts = - annotateStyle opts +layoutString opts = annotateStyle opts . layoutStringAbstract opts + +layoutStringAbstract :: OutputOptions -> String -> SimpleDocStream Annotation +layoutStringAbstract opts = + removeTrailingWhitespace . layoutSmart defaultLayoutOptions {layoutPageWidth = AvailablePerLine (outputOptionsPageWidth opts) 1} . indent (outputOptionsInitialIndent opts) . prettyExprs' opts - . preprocess opts . expressionParse -- | Slight adjustment of 'prettyExprs' for the outermost level, @@ -220,10 +222,10 @@ in if isSimple x then -- keep the expression on the current line - nest 2 $ space <> doc + nest 2 doc else -- put the expression on a new line, indented (unless grouped) - nest (outputOptionsIndentAmount opts) $ line <> doc + nest (outputOptionsIndentAmount opts) $ line' <> doc -- | Construct a 'Doc' from a single 'Expr'. prettyExpr :: OutputOptions -> Expr -> Doc Annotation @@ -231,21 +233,32 @@ Brackets xss -> list "[" "]" xss Braces xss -> list "{" "}" xss Parens xss -> list "(" ")" xss - StringLit s -> join enclose (annotate Quote "\"") $ annotate String $ pretty s + StringLit s -> join enclose (annotate Quote "\"") $ annotate String $ pretty $ + case outputOptionsStringStyle opts of + Literal -> s + EscapeNonPrintable -> escapeNonPrintable $ readStr s + DoNotEscapeNonPrintable -> readStr s CharLit s -> join enclose (annotate Quote "'") $ annotate String $ pretty s Other s -> pretty s NumberLit n -> annotate Num $ pretty n where + readStr :: String -> String + readStr s = fromMaybe s . readMaybe $ '"' : s ++ "\"" list :: Doc Annotation -> Doc Annotation -> CommaSeparated [Expr] -> Doc Annotation list open close (CommaSeparated xss) = enclose (annotate Open open) (annotate Close close) $ case xss of [] -> mempty [xs] | all isSimple xs -> - space <> hsep (map (prettyExpr opts) xs) <> space - _ -> concatWith lineAndCommaSep (map (prettyExprs opts) xss) + space <> hcat (map (prettyExpr opts) xs) <> space + _ -> concatWith lineAndCommaSep (map (\xs -> spaceIfNeeded xs <> prettyExprs opts xs) xss) <> if outputOptionsCompactParens opts then space else line - lineAndCommaSep x y = x <> line' <> annotate Comma "," <> y + where + spaceIfNeeded = \case + Other (' ' : _) : _ -> mempty + _ -> space + lineAndCommaSep x y = x <> munless (outputOptionsCompact opts) line' <> annotate Comma "," <> y + munless b x = if b then mempty else x -- | Determine whether this expression should be displayed on a single line. isSimple :: Expr -> Bool @@ -291,33 +304,7 @@ | Quote | String | Num - --- | Apply various transformations to clean up the 'Expr's. -preprocess :: OutputOptions -> [Expr] -> [Expr] -preprocess opts = map processExpr . removeEmptyOthers - where - processExpr = \case - Brackets xss -> Brackets $ cs xss - Braces xss -> Braces $ cs xss - Parens xss -> Parens $ cs xss - StringLit s -> StringLit $ - case outputOptionsStringStyle opts of - Literal -> s - EscapeNonPrintable -> escapeNonPrintable $ readStr s - DoNotEscapeNonPrintable -> readStr s - CharLit s -> CharLit s - Other s -> Other $ shrinkWhitespace $ strip s - NumberLit n -> NumberLit n - cs (CommaSeparated ess) = CommaSeparated $ map (preprocess opts) ess - readStr :: String -> String - readStr s = fromMaybe s . readMaybe $ '"': s ++ "\"" - --- | Remove any 'Other' 'Expr's which contain only spaces. --- These provide no value, but mess up formatting if left in. -removeEmptyOthers :: [Expr] -> [Expr] -removeEmptyOthers = filter $ \case - Other s -> not $ all isSpace s - _ -> True + deriving (Eq, Show) -- | Replace non-printable characters with hex escape sequences. -- @@ -334,7 +321,7 @@ -- >>> escapeNonPrintable "h\101llo" -- "hello" escapeNonPrintable :: String -> String -escapeNonPrintable input = foldr escape "" input +escapeNonPrintable = foldr escape "" -- | Replace an unprintable character except a newline -- with a hex escape sequence. @@ -343,22 +330,6 @@ | isPrint c || c == '\n' = (c:) | otherwise = ('\\':) . ('x':) . showHex (ord c) --- | Compress multiple whitespaces to just one whitespace. --- --- >>> shrinkWhitespace " hello there " --- " hello there " -shrinkWhitespace :: String -> String -shrinkWhitespace (' ':' ':t) = shrinkWhitespace (' ':t) -shrinkWhitespace (h:t) = h : shrinkWhitespace t -shrinkWhitespace "" = "" - --- | Remove trailing and leading whitespace (see 'Data.Text.strip'). --- --- >>> strip " hello there " --- "hello there" -strip :: String -> String -strip = dropWhile isSpace . dropWhileEnd isSpace - -- | A bidirectional Turing-machine tape: -- infinite in both directions, with a head pointing to one element. data Tape a = Tape diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pretty-simple-4.0.0.0/src/Text/Pretty/Simple.hs new/pretty-simple-4.1.2.0/src/Text/Pretty/Simple.hs --- old/pretty-simple-4.0.0.0/src/Text/Pretty/Simple.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/pretty-simple-4.1.2.0/src/Text/Pretty/Simple.hs 2022-10-15 23:32:22.000000000 +0200 @@ -1,12 +1,8 @@ {-# LANGUAGE CPP #-} -{-# LANGUAGE DeriveDataTypeable #-} -{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE TemplateHaskell #-} {-| Module : Text.Pretty.Simple @@ -124,7 +120,7 @@ import Prettyprinter.Render.Terminal (Color (..), Intensity(Vivid,Dull), AnsiStyle, renderLazy, renderIO) -import System.IO (Handle, stdout) +import System.IO (Handle, stdout, hPutStrLn) import Text.Pretty.Simple.Internal (ColorOptions(..), Style(..), CheckColorTty(..), @@ -530,7 +526,7 @@ NoCheckColorTty -> pure outputOptions liftIO $ do renderIO handle $ layoutStringAnsi realOutputOpts str - putStrLn "" + hPutStrLn handle "" -- | Like 'pShow' but takes 'OutputOptions' to change how the -- pretty-printing is done. @@ -684,6 +680,15 @@ -- , B -- ( B ( B A ) ) ] ) -- +-- >>> pPrintOpt CheckColorTty defaultOutputOptionsDarkBg {outputOptionsCompact = True} $ [("id", 123), ("state", 1), ("pass", 1), ("tested", 100), ("time", 12345)] +-- [ +-- ( "id", 123 ), +-- ( "state", 1 ), +-- ( "pass", 1 ), +-- ( "tested", 100 ), +-- ( "time", 12345 ) +-- ] +-- -- __Initial indent__ -- -- >>> pPrintOpt CheckColorTty defaultOutputOptionsDarkBg {outputOptionsInitialIndent = 3} $ B ( B ( B ( B A ) ) ) @@ -692,6 +697,29 @@ -- ( B ( B A ) ) -- ) -- +-- __Weird/illegal show instances__ +-- +-- >>> pPrintString "2019-02-18 20:56:24.265489 UTC" +-- 2019-02-18 20:56:24.265489 UTC +-- +-- >>> pPrintString "a7ed86f7-7f2c-4be5-a760-46a3950c2abf" +-- a7ed86f7-7f2c-4be5-a760-46a3950c2abf +-- +-- >>> pPrintString "192.168.0.1:8000" +-- 192.168.0.1:8000 +-- +-- >>> pPrintString "A @\"type\" 1" +-- A @"type" 1 +-- +-- >>> pPrintString "2+2" +-- 2+2 +-- +-- >>> pPrintString "1.0e-2" +-- 1.0e-2 +-- +-- >>> pPrintString "0x1b" +-- 0x1b +-- -- __Other__ -- -- Making sure the spacing after a string is correct.