diff options
Diffstat (limited to 'src/Wavefront.hs')
-rw-r--r-- | src/Wavefront.hs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/Wavefront.hs b/src/Wavefront.hs index 2131d96..638b849 100644 --- a/src/Wavefront.hs +++ b/src/Wavefront.hs | |||
@@ -152,6 +152,10 @@ mzeroOBJ = OBJ | |||
152 | parse :: L.ByteString -> OBJ Vector | 152 | parse :: L.ByteString -> OBJ Vector |
153 | parse bs = Rank2.fmap (Vector.fromList . DList.toList) obj | 153 | parse bs = Rank2.fmap (Vector.fromList . DList.toList) obj |
154 | where | 154 | where |
155 | b = objBookKeeping buildOBJ | 155 | go = parseCustom buildOBJ (const $ return ()) bs |
156 | substvars = ObjConfig IntMap.empty | 156 | (obj,_) = execState go (mzeroOBJ,blankElement) |
157 | (obj,_) = execState (runStateT (parseOBJ b substvars bs) emptyCounts) (mzeroOBJ,blankElement) | 157 | |
158 | parseCustom :: Monad m => ObjBuilder m -> (OBJ Count -> m b) -> L.ByteString -> m b | ||
159 | parseCustom builder finish bs = do | ||
160 | counts <- execStateT (parseOBJ (objBookKeeping builder) (ObjConfig IntMap.empty) bs) emptyCounts | ||
161 | finish counts | ||