diff options
| author | Jan Tuomi <jans.tuomi@gmail.com> | 2022-02-18 09:39:53 +0200 |
|---|---|---|
| committer | Jan Tuomi <jans.tuomi@gmail.com> | 2022-02-18 09:39:53 +0200 |
| commit | dc1ef25f1a7f8e36e93928e5b0288e203833e14a (patch) | |
| tree | b2baa429efd629e55bcd8455a5e46be198d2eba1 /src/Main.hs | |
| parent | 7a6dc3758c361aa7685934a1896db9f23f1d74be (diff) | |
Clean up
Diffstat (limited to 'src/Main.hs')
| -rw-r--r-- | src/Main.hs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/Main.hs b/src/Main.hs index b596a84..1673663 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -2,6 +2,7 @@ module Main where import Control.Monad.Except import Data.Char +import Data.List (intercalate) import Data.Map (Map, (!)) import qualified Data.Map as M import Debug.Trace (trace, traceShow) @@ -41,8 +42,14 @@ bootstrap args = do debugPrint config $ fmt "executing file %%\n" [fileName] source <- liftIO . readFile $ fileName (parsedSource, strLitRefMap) <- parseSource source - debugPrint config $ fmt "parsed words:\n%%\n" [show parsedSource] - debugPrint config $ fmt "string literal refmap:\n%%\n" [show strLitRefMap] + debugPrint config $ fmt "parsed words:\n%%\n" [parsedSource $> map show .> intercalate ", "] + let reprKeyValPair (k, v) = fmt "%% = %%" [k, show v] + debugPrint config $ + fmt + "string literal refmap:\n%%\n" + [ strLitRefMap + $> M.toList .> map reprKeyValPair .> intercalate "\n" + ] debugPrint config "interpreter output:" let initialState = LState |
