summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2022-02-22 14:39:19 +0100
committerTom Smeding <tom@tomsmeding.com>2022-02-22 14:39:19 +0100
commitf859444fbe15812c3eb96cfc1377723c7a853aeb (patch)
tree6cc9eba16e6190824502194673ae60685ada0b2d
parentc23b7b5517d7ac5d0a6b2ff8a4f4914c2f392261 (diff)
Fix columns in parserHEADmaster
-rw-r--r--Parse.hs13
1 files changed, 8 insertions, 5 deletions
diff --git a/Parse.hs b/Parse.hs
index 0ee5004..e4eca84 100644
--- a/Parse.hs
+++ b/Parse.hs
@@ -12,6 +12,8 @@ import Data.ByteString (ByteString)
import Data.Char
import Data.List (unfoldr)
+import Debug.Trace
+
import Prof
@@ -29,6 +31,7 @@ data Columns
parseProf :: ByteString -> Either String (Prof ())
parseProf input = do
(cols, lns) <- maybe (Left "Did not find tree header") Right (findTree (BS.split 10 input))
+ traceM (show cols)
lns' <- concat <$> mapM (parseLine cols) lns
case buildTree lns' of
Just (tree, []) -> return (Prof tree)
@@ -102,11 +105,11 @@ parseLeadingTreeLine bs = do
return $ Columns { cMod = cmod
, cSrc = csrc
, cNo = cno
- , cCnt = cno + 5
- , cIvT = centr + 6
- , cIvA = civt + 4
- , cIhT = civa + 5
- , cIhA = ciht + 4 }
+ , cCnt = cno + 6
+ , cIvT = centr + 7
+ , cIvA = civt + 5
+ , cIhT = civa + 6
+ , cIhA = ciht + 5 }
where
findCol :: String -> Int -> ByteString -> Maybe (Int, ByteString)
findCol stag from = \line ->