File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ module Main (
19
19
) where
20
20
21
21
import Web.Scotty
22
- import Language.PureScript
22
+ import qualified Language.PureScript as P
23
23
24
24
import Data.Monoid
25
25
import Data.String
@@ -44,16 +44,14 @@ data Response = Response (Either String Compiled)
44
44
compile :: String -> IO Response
45
45
compile input | length input > 5000 = return $ Response $ Left " Please limit your input to 5000 characters"
46
46
compile input = do
47
- case runIndentParser parseDeclarations input of
47
+ case P. runIndentParser P. parseDeclarations input of
48
48
Left parseError -> do
49
49
return $ Response $ Left $ show parseError
50
50
Right decls -> do
51
- case check (typeCheckAll decls) of
52
- Left typeError -> do
53
- return $ Response $ Left typeError
54
- Right (_, env) -> do
55
- let js = intercalate " ;\n " . map (prettyPrintJS . optimize) . concat . mapMaybe (declToJs Nothing global) $ decls
56
- let externs = intercalate " \n " $ mapMaybe (externToPs 0 global env) decls
51
+ case P. compile decls of
52
+ Left error ->
53
+ return $ Response $ Left error
54
+ Right (js, externs, _) ->
57
55
return $ Response $ Right $ Compiled js externs
58
56
59
57
str :: String -> String
You can’t perform that action at this time.
0 commit comments