git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Default entry point to "Main" when using --run-main
commitdc8b726d628fb821ddb5d187c3de123bcf9b9037 authorGary Burgess <gary.burgess@gmail.com> dateSat 15 Feb 2014, 11:18 (13 years ago) parent18082c7
1 file changed+2−2
src/Language/PureScript.hs+2−2
src/Language/PureScript.hs+2−2
@@ -33,7 +33,7 @@ import Data.List (intercalate)
3333import Data.Maybe (mapMaybe)
3434import Control.Monad (when, forM)
3535import Control.Monad.State.Lazy
36−import Control.Applicative ((<$>))
36+import Control.Applicative ((<$>), (<|>))
3737import qualified Data.Map as M
3838
3939-- |
@@ -63,7 +63,7 @@ compile opts ms = do
6363 modify (\s -> s { checkCurrentModule = Just (ModuleName moduleName) })
6464 Module moduleName <$> typeCheckAll (ModuleName moduleName) decls
6565 regrouped <- createBindingGroupsModule . collapseBindingGroupsModule $ elaborated
66− let entryPoint = optionsEntryPoint opts
66+ let entryPoint = optionsEntryPoint opts <|> if (optionsRunMain opts) then Just "Main" else Nothing
6767 let elim = maybe regrouped (\ep -> eliminateDeadCode env ep regrouped) entryPoint
6868 let js = mapMaybe (flip (moduleToJs opts) env) elim
6969 let exts = intercalate "\n" . map (flip moduleToPs env) $ elim