Commit 9f12dee8 authored by Diederik van Arkel's avatar Diederik van Arkel
Browse files

avoid problem with strict lists for large input files

parent 29528135
...@@ -70,7 +70,7 @@ textToStringsC { blocks } ...@@ -70,7 +70,7 @@ textToStringsC { blocks }
stringsToText :: (StrictList String) -> Text stringsToText :: (StrictList String) -> Text
stringsToText lines stringsToText lines
# (_,lines) = annotWhole lines # lines = annotWhole lines
= { nrLines = slLength lines = { nrLines = slLength lines
, blocks = group BlockSize lines , blocks = group BlockSize lines
} }
......
...@@ -5,5 +5,5 @@ definition module syncol ...@@ -5,5 +5,5 @@ definition module syncol
import StdString import StdString
import StrictList import StrictList
firstParse :: !(StrictList String) -> (Int, StrictList (Int,String)) firstParse :: !(StrictList String) -> StrictList (Int,String)
quickParse :: !Int !Int !(StrictList (Int,String)) -> (Int,StrictList (Int,String)) quickParse :: !Int !Int !(StrictList (Int,String)) -> (Int,StrictList (Int,String))
...@@ -83,7 +83,17 @@ where ...@@ -83,7 +83,17 @@ where
/* /*
firstParse: textlines -> zip initial comment nesting level & textlines firstParse: textlines -> zip initial comment nesting level & textlines
*/ */
firstParse :: !(StrictList String) -> (Int, StrictList (Int,String)) firstParse :: !(StrictList String) -> StrictList (Int,String)
firstParse lines
= slFromList (fP 0 lines)
where
fP i SNil
= []
fP i (SCons h t)
#! j = parseLine i h
= [ (i,h) : (fP j t) ]
/*
firstParse lines firstParse lines
= fP 0 lines = fP 0 lines
where where
...@@ -93,6 +103,7 @@ where ...@@ -93,6 +103,7 @@ where
#! j = parseLine i h #! j = parseLine i h
# (k,r) = fP j t # (k,r) = fP j t
= (k,SCons (i,h) r) = (k,SCons (i,h) r)
*/
/* /*
quickParse: (first modified line) (last modified line) textlines quickParse: (first modified line) (last modified line) textlines
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment