diff options
Diffstat (limited to 'src')
| -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 |
