summaryrefslogtreecommitdiff
path: root/MtlParser.hs
diff options
context:
space:
mode:
Diffstat (limited to 'MtlParser.hs')
-rw-r--r--MtlParser.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/MtlParser.hs b/MtlParser.hs
index a59c0eb..488ec4e 100644
--- a/MtlParser.hs
+++ b/MtlParser.hs
@@ -71,7 +71,9 @@ parseLine s = case words $ takeWhile (/='#') s of
71 _ -> return () 71 _ -> return ()
72 72
73parseMtl :: String -> MtlLib 73parseMtl :: String -> MtlLib
74parseMtl src = Map.fromList [(mtl_Name m,m) | m <- evalState (execWriterT (mapM_ parseLine (lines src) >> addMaterial)) Nothing] 74parseMtl src =
75 Map.insert mempty (newMaterial mempty)
76 $ Map.fromList [(mtl_Name m,m) | m <- evalState (execWriterT (mapM_ parseLine (lines src) >> addMaterial)) Nothing]
75 77
76readMtl :: String -> IO MtlLib 78readMtl :: String -> IO MtlLib
77readMtl fname = parseMtl <$> readFile fname 79readMtl fname = parseMtl <$> readFile fname