From 42eef741086804aa106870f5a375c65ac5d83ab2 Mon Sep 17 00:00:00 2001 From: Joe Crayne Date: Tue, 11 Jun 2019 02:29:26 -0400 Subject: Sundqvist: Allow leading spaces. --- src/Graphics/WaveFront/Parse/OBJ.hs | 2 +- test/TestSundqvist.hs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Graphics/WaveFront/Parse/OBJ.hs b/src/Graphics/WaveFront/Parse/OBJ.hs index 69cce47..2c3919e 100644 --- a/src/Graphics/WaveFront/Parse/OBJ.hs +++ b/src/Graphics/WaveFront/Parse/OBJ.hs @@ -72,7 +72,7 @@ obj = Atto.sepBy row lineSeparator -- <* Atto.endOfInput -- - Handle invalid rows (how to deal with mangled definitions w.r.t indices?) -- - Use ListLike or Monoid (or maybe Indexable, since that's the real requirement) (?) row :: (Fractional f, Integral i) => Atto.Parser (OBJToken f Text i []) -row = token <* ignore comment -- TODO: Let the separator handle comments (?) +row = Atto.skipSpace *> token <* ignore comment -- TODO: Let the separator handle comments (?) -- | diff --git a/test/TestSundqvist.hs b/test/TestSundqvist.hs index 6345cd9..935368a 100644 --- a/test/TestSundqvist.hs +++ b/test/TestSundqvist.hs @@ -18,4 +18,4 @@ main = do r1 <- Load.obj (ddir ++ "/01.obj") print r1 -- Failed: endOfInput - -- Reason: vp token, leading spaces, empty lines + -- Reason: vp token,and blank lines -- cgit v1.2.3