Permalink
Browse files

Correct web API boolean representation.

  • Loading branch information...
1 parent 6a056c8 commit 520680617c715e387a2e417cf34ecb50910945a7 @colah committed Nov 30, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 implicitsnap.hs
View
@@ -103,11 +103,13 @@ getWidth (varlookup, obj:_, _) = max (x2-x1) (y2-y1)
executeAndExport :: String -> String -> Maybe String -> String
executeAndExport content callback maybeFormat =
let
+ showB True = "true"
+ showB False = "false"
callbackF :: Bool -> Bool -> Float -> String -> String
callbackF False is2D w msg =
- callback ++ "([null," ++ show msg ++ "," ++ show is2D ++ "," ++ show w ++ "]);"
+ callback ++ "([null," ++ show msg ++ "," ++ showB is2D ++ "," ++ show w ++ "]);"
callbackF True is2D w msg =
- callback ++ "([new Shape()," ++ show msg ++ "," ++ show is2D ++ "," ++ show w ++ "]);"
+ callback ++ "([new Shape()," ++ show msg ++ "," ++ showB is2D ++ "," ++ show w ++ "]);"
callbackS str msg = callback ++ "([" ++ show str ++ "," ++ show msg ++ ",null,null]);"
in case runOpenscad content of
Left err ->

0 comments on commit 5206806

Please sign in to comment.