Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Force parser errors instead of failing quietly.

  • Loading branch information...
commit c8451baa6701aff5b437096b5e7a233f89997707 1 parent 16c5016
@colah colah authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 Graphics/Implicit/ExtOpenScad.hs
View
4 Graphics/Implicit/ExtOpenScad.hs
@@ -9,11 +9,11 @@ import Graphics.Implicit.ExtOpenScad.Definitions (OpenscadObj (..) )
import Graphics.Implicit.ExtOpenScad.Default (defaultObjects)
import Graphics.Implicit.ExtOpenScad.Statements (computationStatement, runComputations)
-import Text.ParserCombinators.Parsec (parse, many1)
+import Text.ParserCombinators.Parsec (parse, many1, many, space, eof)
import Control.Monad (liftM)
-- Small wrapper to handle parse errors, etc
-runOpenscad str = case parse (many1 computationStatement) "" str of
+runOpenscad str = case parse (do {s <- many1 computationStatement; many space; eof; return s}) "" str of
Right res -> Right $ runComputationsDefault res
Left err -> Left err
Please sign in to comment.
Something went wrong with that request. Please try again.